Sid
0d66d298ec
Enable Ruff RET504 ( #114528 )
...
* Enable Ruff RET504
* fix test
* Use noqa instead of cast
* fix sonos RET504
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
Marc Mueller
59a6035d3f
Add empty line after module docstring [j-m] ( #112700 )
2024-03-08 09:01:29 -05:00
J. Nick Koston
f73431ac06
Switch utc_to_timestamp to .timestamp() where possible ( #109729 )
...
* Switch utc_to_timestamp to .timestamp()
.timestamp() is faster now in newer cpython
```
from homeassistant.util.dt import utc_to_timestamp, utcnow
import timeit
now = utcnow()
print(timeit.timeit('utc_to_timestamp(now)',globals={"now":now,"utc_to_timestamp":utc_to_timestamp}))
print(timeit.timeit('now.timestamp()',globals={"now":now}))
```
utc_to_timestamp = 0.18721245788037777
timestamp = 0.11421508435159922
* compat
* revert
* revert
* revert
* revert
* revert
2024-02-05 23:04:52 +01:00
Marc Mueller
a70ec64408
Update mypy to 1.7.0 ( #103800 )
2023-11-11 23:31:04 +01:00
J. Nick Koston
b76551cf35
Reduce number of columns selected for logbook ( #91718 )
2023-04-22 14:25:22 +02:00
J. Nick Koston
2530031454
Use cache to lookup event type ids in logbook ( #91576 )
...
noticed we can speed this up while looking at
https://github.com/home-assistant/core/issues/91514
Note: this will not fix that issue as there is more going on there
2023-04-17 23:40:03 -04:00
J. Nick Koston
d21433b6af
Ensure filters are generated inside the lambda locks ( #90418 )
2023-03-28 20:50:10 +02:00
J. Nick Koston
f1ec77b8e0
Small cleanups to logbook statement generator ( #90200 )
...
We should only convert the context id to binary if
its going to be used.
Avoid some intermediate vars that are no longer needed
2023-03-23 20:56:58 -04:00
J. Nick Koston
f27d73fc34
Remove legacy event lookups from logbook ( #89945 )
...
Events recorded with Home Assistant 2022.5.x or older will no
longer display context information in the logbook
2023-03-19 22:05:07 -04:00
J. Nick Koston
c41f91be89
Deduplicate entity_id in the states table ( #89557 )
2023-03-12 10:01:58 -10:00
J. Nick Koston
8bd43760b6
Deduplicate event_types in the events table ( #89465 )
...
* Deduplicate event_types in the events table
* Deduplicate event_types in the events table
* more fixes
* adjust
* adjust
* fix product
* fix tests
* adjust
* migrate
* migrate
* migrate
* more test fixes
* more test fixes
* fix
* migration test
* adjust
* speed up
* fix index
* fix more tests
* handle db failure
* preload
* tweak
* adjust
* fix stale docs strings, remove dead code
* refactor
* fix slow tests
* coverage
* self join to resolve query performance
* fix typo
* no need for quiet
* no need to drop index already dropped
* remove index that will never be used
* drop index sooner as we no longer use it
* Revert "remove index that will never be used"
This reverts commit 461aad2c52
.
* typo
2023-03-11 14:54:55 -05:00
J. Nick Koston
86ad8261d8
Update logbook queries for SADeprecationWarning ( #87108 )
2023-03-09 13:03:08 +01:00
J. Nick Koston
170a13302c
Reduce overhead to store context ids in the database ( #88942 )
2023-03-08 14:51:45 -10:00
Erik Montnemery
94519de8dd
Upgrade SQLAlchemy to 2.0.2 ( #86436 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-02-08 08:17:32 -06:00
epenet
b4dd1b8cb2
Rename logbook constant ( #86464 )
2023-01-23 18:00:25 +02:00
Marc Mueller
077ca97ef8
Fix local_partial_types
errors ( #86410 )
...
Fix local_partial_types errors
2023-01-23 10:29:11 +01:00
J. Nick Koston
b8a1537b58
Improve performance of fetching and storing history and events with the database ( #84870 )
2023-01-02 13:26:08 -10:00
J. Nick Koston
f29cc33fa0
Fix selecting entity_ids and device_ids in events with MySQL and PostgreSQL with logbook ( #73918 )
...
* Fix selecting entity_ids and device_ids in events with MySQL and PostgreSQL
Fixes #73818
* add cover
2022-06-24 15:43:35 +02:00
J. Nick Koston
28dd92d928
Fix logbook state query with postgresql ( #73924 )
2022-06-23 23:35:10 +02:00
J. Nick Koston
00a79635c1
Revert "Remove sqlalchemy lambda_stmt usage from history, logbook, and statistics ( #73191 )" ( #73917 )
2022-06-23 13:59:55 -05:00
J. Nick Koston
7ae8bd5137
Remove sqlalchemy lambda_stmt usage from history, logbook, and statistics ( #73191 )
2022-06-07 16:15:50 -07:00
Erik Montnemery
5f2b4001f3
Separate recorder database schema from other classes ( #72977 )
...
* Separate recorder database schema from other classes
* fix logbook imports
* migrate new tests
* few more
* last one
* fix merge
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-07 14:41:43 +02:00
J. Nick Koston
0b62944148
Mark counter domain as continuous to exclude it from logbook ( #73101 )
2022-06-05 21:25:26 -10:00
J. Nick Koston
9fbde245d0
Fix performance of logbook entity and devices queries with large MySQL databases ( #72898 )
2022-06-02 14:54:06 -07:00
J. Nick Koston
bfa7693d18
Fixes for logbook filtering and add it to the live stream ( #72501 )
2022-05-25 15:17:08 -10:00
J. Nick Koston
985bcb23f2
Fix SAWarning in logbook queries ( #72101 )
2022-05-18 12:33:58 -05:00
J. Nick Koston
c4fc84ec1e
Add support for selecting device_ids from the logbook ( #72039 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-18 01:58:30 -05:00