Commit graph

1000 commits

Author SHA1 Message Date
Erik Montnemery
6eeb70151d
Use BIGINT SQL type for ID columns (#121025) 2024-07-05 10:42:39 -05:00
Erik Montnemery
61f1c8d963
Fix leak of SQLAlchemy engine objects in recorder (#121085) 2024-07-03 12:17:52 -05:00
Erik Montnemery
e26b4554e6
Improve logic when retrying establishing database connection (#121047) 2024-07-03 16:22:21 +02:00
Erik Montnemery
a4d889e958
Remove BaseTableManager active attribute (#121020) 2024-07-02 18:29:12 -05:00
Erik Montnemery
5b39989869
Fix typo in post_schema_migration (#121017) 2024-07-02 15:52:54 +02:00
Marc Mueller
ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
J. Nick Koston
c5804d362c
Remove legacy foreign key constraint from sqlite states table (#120779) 2024-06-29 07:50:53 -05:00
J. Nick Koston
852bb19223
Cleanup db_schema from_event constructors (#120803) 2024-06-29 07:49:16 -05:00
J. Nick Koston
0dfb5bd7d9
Fix unneeded dict values for MATCH_ALL recorder attrs exclude (#120804)
* Small cleanup to handling MATCH_ALL recorder attrs exclude

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed
2024-06-29 07:42:08 +02:00
J. Nick Koston
b03c10647e
Fix stale docstring in recorder queries (#120763) 2024-06-28 16:29:12 -05:00
Marc Mueller
b798d76706
Update mypy-dev to 1.11.0a9 (#120289) 2024-06-24 09:57:15 +02:00
G Johansson
753ab08b5e
Add capability to exclude all attributes from recording (#119725) 2024-06-22 19:30:28 +02:00
Marc Mueller
f0452e9ba0
Update mypy dev 1.11.0a8 (#120032) 2024-06-21 13:15:18 +02:00
dontinelli
0dd5391cd7
Add Siemes and Millisiemens as additional units of conductivity and enable conversion between conductivity units (#118728) 2024-06-21 11:10:15 +02:00
J. Nick Koston
a642454e6f
Bump sqlalchemy to 2.0.31 (#119951) 2024-06-19 08:09:04 +02:00
J. Nick Koston
9082dc2a79
Reduce recorder overhead when entity filter is empty (#119631) 2024-06-14 08:43:51 +02:00
Erik Montnemery
8c27214dc9
Use statistic tables' duration attribute instead of magic numbers (#119356) 2024-06-11 15:12:20 +02:00
J. Nick Koston
3308f07d4b
Speed up generating large stats results (#119210)
* Speed up generating large stats results

* naming

* fix type

* fix type

* tweak

* tweak

* delete unused code
2024-06-10 21:22:59 -04:00
Erik Montnemery
def9d5b101
Fix statistic_during_period after core restart (#119323) 2024-06-10 21:44:55 +02:00
karwosts
aa419686cb
Fix statistic_during_period wrongly prioritizing ST statistics over LT (#115291)
* Fix statistic_during_period wrongly prioritizing ST statistics over LT

* comment

* start of a test

* more testcases

* fix sts insertion range

* update from review

* remove unneeded comments

* update logic

* min/mean/max testing
2024-06-10 20:23:21 +02:00
J. Nick Koston
7065c0993d
Reduce overhead to reduce statistics (#119187) 2024-06-09 18:33:10 +02:00
J. Nick Koston
909df675e0
Use a listcomp for history results (#119188) 2024-06-09 18:32:33 +02:00
Marc Mueller
fe21e2b8ba
Import Generator from typing_extensions (1) (#118986) 2024-06-06 17:02:13 +02:00
J. Nick Koston
35a1ecea27
Speed up statistics_during_period websocket api (#118672) 2024-06-03 18:08:46 -05:00
J. Nick Koston
588380392d
Small speed up to read-only database sessions (#118674) 2024-06-03 19:50:05 +02:00
J. Nick Koston
099ad77078
Migrate recorder instance to use HassKey (#118673) 2024-06-03 11:19:00 -05:00
J. Nick Koston
134088e1f6
Revert "Add websocket API to get list of recorded entities (#92640)" (#118644)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-06-03 10:11:24 +02:00
J. Nick Koston
51ed4f89ec
Use more efficient chunked_or_all for recorder table managers (#118646) 2024-06-02 13:04:53 -05:00
Marc Mueller
dbb27755a4
Update mypy-dev to 1.11.0a5 (#118519) 2024-06-02 15:28:24 +02:00
J. Nick Koston
0888233f06
Make Recorder dialect_name a cached_property (#117922) 2024-05-29 09:23:40 +02:00
Jan Bouwhuis
c616fc036e
Move recorder chunk utils to shared collection utils (#118065) 2024-05-24 12:49:39 -10:00
Marc Mueller
dd22ee3dac
Improve annotation styling (#118032) 2024-05-24 15:05:53 +02:00
Sid
c2b3bf3fb9
Enable Ruff RET502 (#115139) 2024-05-21 22:19:33 +02:00
Marc Mueller
bc2ee96cae
Remove quotes surrounding annotations (#117817) 2024-05-20 22:06:58 +02:00
J. Nick Koston
5a609c34bb
Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Marc Mueller
eedce95bc9
Use PEP 695 for class annotations (2) (#117776) 2024-05-20 10:43:59 +02:00
Marc Mueller
26a599ad11
Use PEP 695 for function annotations (1) (#117658) 2024-05-18 11:45:54 +02:00
Marc Mueller
907b9c42e5
Use PEP 695 for decorator typing with type aliases (2) (#117663) 2024-05-18 11:41:46 +02:00
dfaour
6f5e820090
Improve recorder statistics error messages (#113498)
* Update statistics.py

Added more detail error descriptions to make debugging easier

* Update statistics.py

formatting corrected
2024-05-16 13:44:03 +02:00
J. Nick Koston
3f053eddbd
Add websocket API to get list of recorded entities (#92640)
* Add API to get list of recorded entities

* update for latest codebase

* ruff

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* add suggested test
2024-05-15 08:41:56 +02:00
J. Nick Koston
d06932bbc2
Refactor asyncio loop protection to improve performance (#117295) 2024-05-13 07:01:55 +09:00
Sid
2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
J. Nick Koston
fd52588565
Bump SQLAlchemy to 2.0.30 (#116964) 2024-05-07 10:42:13 +02:00
Sid
b456d97e65
Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
J. Nick Koston
6339c63176
Improve recorder and worker thread matching in RecorderPool (#116886)
* Improve recorder and worker thread matching in RecorderPool

Previously we would look at the name of the threads. This
was a brittle if because other integrations may name their
thread Recorder or DbWorker. Instead we now use explict thread
ids which ensures there will never be a conflict

* fix

* fixes

* fixes
2024-05-05 16:25:10 -04:00
Patrick Decat
ac12d2a463
fix UnboundLocalError on modified_statistic_ids in compile_statistics (#116795)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-04 13:16:58 -05:00
karwosts
2ac44f6083
Make recorder.purge_entities require at least one entity filter value (#110066)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-22 20:10:18 +02:00
Sid
3799d20d43
Enable Ruff B905 (#114197) 2024-04-14 00:14:26 -05:00
Marc Mueller
2decf6c023
Use dict instead of MutableMapping [recorder] (#115318) 2024-04-09 15:08:31 -10:00
Marc Mueller
d4500cf945
Improve recorder event typing (#115253) 2024-04-08 14:56:18 -10:00