Commit graph

517 commits

Author SHA1 Message Date
Marc Mueller
24bf42cfbe
Update pylint to 2.14.3 (#73703) 2022-06-19 16:29:57 +02:00
Paulus Schoutsen
53b3d2ee87
Guard MySQL size calculation returning None (#73331) 2022-06-10 12:49:58 -07: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
de2e9b6d77
Fix state_changes_during_period history query when no entities are passed (#73139) 2022-06-06 12:50:52 -07: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
c66b000d34
Reduce branching in generated lambda_stmts (#73042) 2022-06-05 21:13:31 -07:00
J. Nick Koston
7ac7af094f
Fix missing historical context data in logbook for MySQL and PostgreSQL (#73011) 2022-06-04 12:54:10 -07:00
J. Nick Koston
8e8fa0399e
Fix statistics_during_period being incorrectly cached (#72947) 2022-06-03 13:04:46 -07:00
J. Nick Koston
5b31414225
Fix misalignments between sql based filtering with the entityfilter based filtering (#72936) 2022-06-02 20:52:53 -07: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
cd590c79e2
Fix migration of MySQL data when InnoDB is not being used (#72893)
Fixes #72883
2022-06-02 14:01:06 +02:00
J. Nick Koston
f79e5e002b
Ensure recorder shuts down when its startup future is canceled out from under it (#72866) 2022-06-01 22:13:09 -07:00
J. Nick Koston
c6e56c26b3
Fix logbook not setting up with an recorder filter that has empty fields (#72869) 2022-06-01 22:12:00 -07:00
GitHub Action
7746715590 [ci skip] Translation update 2022-06-02 00:27:51 +00:00
J. Nick Koston
d8b0376942
Fix purge of legacy database events that are not state changed (#72815) 2022-06-01 11:56:06 +02:00
J. Nick Koston
e874a04319
Bump sqlalchemy to 1.4.37 (#72809)
Fixes a bug where reconnects might fail with MySQL 8.0.24+

Changelog: https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-1.4.37
2022-06-01 10:56:05 +02:00
GitHub Action
0df9cc907a [ci skip] Translation update 2022-06-01 00:27:00 +00:00
J. Nick Koston
856e1144c9
Ensure the statistics_meta table is using the dynamic row format (#72784) 2022-05-31 14:35:28 -07:00
J. Nick Koston
c365454afb
Revert "Initial orjson support (#72754)" (#72789)
This was causing the wheels to fail to build. We need
to workout why when we don't have release pressure

This reverts commit d9d22a9556.
2022-05-31 13:51:55 -07:00
J. Nick Koston
d9d22a9556
Initial orjson support (#72754) 2022-05-31 12:18:11 -07:00
J. Nick Koston
587fd05603
Make logbook inherit the recorder filter (#72728) 2022-05-30 17:34:32 -07:00
GitHub Action
362f5720ed [ci skip] Translation update 2022-05-31 00:23:11 +00:00
GitHub Action
3c5b778ee3 [ci skip] Translation update 2022-05-30 00:27:06 +00:00
J. Nick Koston
a43d47fa0b
Escape % and _ in history/logbook entity_globs, and use ? as _ (#72623)
Co-authored-by: pyos <pyos100500@gmail.com>
2022-05-27 14:38:29 -07:00
J. Nick Koston
34323ce645
Add explict type casts for postgresql filters (#72615) 2022-05-27 08:11:33 -10:00
J. Nick Koston
040e120101
Fix recorder system health when the db_url is lacking a hostname (#72612) 2022-05-27 10:32:26 -07:00
J. Nick Koston
049c06061c
Fix memory leak when firing state_changed events (#72571) 2022-05-26 20:54:26 -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
Marc Mueller
3c246b7800
Update mypy to 0.960 (#72481) 2022-05-25 11:42:14 -07:00
GitHub Action
301341a49f [ci skip] Translation update 2022-05-25 00:26:18 +00:00
Erik Montnemery
23bd64b7a2
Prevent duplication of statistics metadata (#71637)
* Prevent duplication of statistics metadata

* Add models_schema_28.py

* Handle entity renaming as a recorder job

* Improve tests
2022-05-24 15:34:46 +02:00
GitHub Action
abbfed24a4 [ci skip] Translation update 2022-05-24 00:25:27 +00:00
J. Nick Koston
4dbc1ed7a7
Add dialect (database engine) and version to recorder system health data (#72339) 2022-05-22 21:29:30 -07:00
J. Nick Koston
9c3f949165
Add live streaming logbook websocket endpoint (#72258)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-22 14:57:54 -05:00
J. Nick Koston
1001f9e39a
Fix last state in history minimal respones when all the states at the end are skipped (#72203) 2022-05-19 20:58:32 -07:00
Erik Montnemery
edd7a3427c
Remove support for databases without ROW_NUMBER (#72092) 2022-05-18 21:52:38 -05:00
GitHub Action
3a13ffcf13 [ci skip] Translation update 2022-05-19 00:26:11 +00:00
Erik Montnemery
037f6947d8
Fail recorder setup with unsupported dialect or version (#70888) 2022-05-18 16:52:46 +02:00
J. Nick Koston
f3c582815c
Convert statistics to use lambda_stmt (#71903)
* Convert stats to use lambda_stmt

- Since baked queries are now [deprecated in 1.4](https://docs.sqlalchemy.org/en/14/orm/extensions/baked.html#module-sqlalchemy.ext.baked) the
  next step is to convert these to `lambda_stmt`

https://docs.sqlalchemy.org/en/14/core/connections.html#quick-guidelines-for-lambdas

* Update homeassistant/components/recorder/statistics.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-05-18 16:22:21 +02: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
GitHub Action
1d6659224f [ci skip] Translation update 2022-05-18 00:22:07 +00:00
J. Nick Koston
a4c1bcefb9
Tune sqlite based on configured settings (#72016) 2022-05-17 18:12:15 -05:00
J. Nick Koston
8fcee01db0
Remove unnecessary flush from recorder (#71910) 2022-05-16 18:03:02 -05:00
J. Nick Koston
f4a2afeb37
Guard against recorder pool current connection disappearing during global destruction (#71971) 2022-05-16 17:48:14 -05:00
J. Nick Koston
a70e2a33dc
Fixing purging legacy rows and improve performance (#71916) 2022-05-15 21:25:07 -07:00
J. Nick Koston
089eb9960a
Reduce logbook websocket payload size and parse json attributes via the DBM (#71895) 2022-05-15 20:48:57 -07:00
GitHub Action
37f81b261d [ci skip] Translation update 2022-05-16 00:24:28 +00:00
J. Nick Koston
98809675ff
Convert history queries to use lambda_stmt (#71870)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-15 10:47:29 -05:00
J. Nick Koston
1f753ecd88
Relocate sqlalchemy filter builder to recorder/filters.py (#71883) 2022-05-14 23:04:23 -07:00