Commit graph

499 commits

Author SHA1 Message Date
Marc Mueller
f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
J. Nick Koston
c5804d362c
Remove legacy foreign key constraint from sqlite states table (#120779) 2024-06-29 07:50:53 -05:00
Joost Lekkerkerker
c13786c952
Fix ruff manual-dict-comprehension PERF403 in tests (#120738)
Fix PERF403 in tests
2024-06-28 12:14:24 +02:00
G Johansson
753ab08b5e
Add capability to exclude all attributes from recording (#119725) 2024-06-22 19:30:28 +02:00
epenet
83b97d3218
Add missing argument type hints to recorder tests (#119672) 2024-06-14 09:25:26 +02:00
epenet
2f5f372f63
Remove pointless TODO in recorder tests (#119490) 2024-06-12 18:08:01 +02:00
epenet
0f0c2f0553
Fix redefined-argument-from-local pylint warning in tests (#119475) 2024-06-12 17:58:58 +02:00
epenet
7388271689
Fix unspecified-encoding warnings in tests (#119405) 2024-06-11 17:58:40 +02:00
epenet
2c7022950c
Fix import-outside-toplevel pylint warnings in tests (#119389) 2024-06-11 14:57:50 +02: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
epenet
ac588ddc75
Use relative imports in tests [j-r] (#119282) 2024-06-10 13:32:31 +02:00
Sid
721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
Marc Mueller
837ee7c4fb
Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet
b54a68750b
Add type hints for FixtureRequest in tests (#118779) 2024-06-04 10:37:54 +02:00
J. Nick Koston
35a1ecea27
Speed up statistics_during_period websocket api (#118672) 2024-06-03 18:08:46 -05:00
epenet
8772a59f5c
Add type hints for Recorder in test fixtures (#118685) 2024-06-03 10:17:51 +02: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
epenet
1317837986
Improve type hints in tests (q-z) (#118381) 2024-05-30 08:48:02 +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
epenet
44f715bd02
Use issue_registry fixture in component tests (#118041) 2024-05-24 15:54:20 +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
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
ac54cdcdb4
Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00
Erik Montnemery
1cea22b8ba
Fix search/replace mistake in recorder tests (#116933) 2024-05-06 09:03:21 -05:00
Erik Montnemery
2e945aed54
Convert recorder auto_repairs tests to use async API (#116927) 2024-05-06 08:25:48 -05:00
Erik Montnemery
5150557372
Convert recorder util tests to use async API (#116926) 2024-05-06 08:25:41 -05:00
Erik Montnemery
9807b2ec11
Convert recorder statistics tests to use async API (#116925) 2024-05-06 08:10:58 -05:00
Erik Montnemery
d01d161fe2
Convert recorder history tests to use async API (#116909) 2024-05-06 08:10:45 -05:00
Erik Montnemery
f5fe80bc90
Convert recorder init tests to use async API (#116918) 2024-05-06 07:59:39 -05: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
Erik Montnemery
e9b9d2d545
Convert recorder entity registry tests to use async API (#116448)
* Convert recorder entity registry tests to use async API

* Address review comment

* Make sure recorder is patch is set up before hass fixture
2024-05-03 14:10:58 +02:00
Erik Montnemery
27fcf72275
Convert history tests to use async API (#116447)
* Convert history tests to use async API

* Add new fixture to help patch recorder

* Modify

* Modify

* Update tests/conftest.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Rename fixture

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-03 08:14:46 +02:00
Erik Montnemery
aa65f21be7
Fix flapping recorder tests (#116239) 2024-04-26 09:05:23 -05:00
Erik Montnemery
10be8f9683
Simplify timezone setting in recorder test (#116220) 2024-04-26 15:14:23 +02: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
895f73d8e4
Enable Ruff A001 (#115654) 2024-04-21 23:25:27 +02:00
Sid
3efee10b95
Enable Ruff RUF013 (#115333) 2024-04-10 08:55:59 +02:00
Sid
f8b6629b26
Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
Sid
8e98ba7312
Add first batch of Ruff PYI rules (#115100)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-07 11:30:50 -10:00
J. Nick Koston
5447a1a015
Ensure all tables have the default table args in the db_schema (#114895) 2024-04-05 08:22:00 +02:00
Sid
d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Sid
aec7a67a58
Unignore Ruff PLE, PLW in tests (#114406)
* Unignore Ruff PLE, PLW in tests

* fix tests
2024-03-29 23:58:30 +01:00
Erik Montnemery
4d7a434254
Don't access States.last_reported_ts before it's added (#114333) 2024-03-28 00:44:01 +01:00
Erik Montnemery
a3059fe504
Record state.last_reported (#114201)
* Record state.last_reported

* Include last_reported in parts of the history API

* Use a bulk update

* fix refactoring error

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-27 12:48:06 +01:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
81c34ac952
Fix spelling [docstrings + comments] (#114168) 2024-03-25 11:33:00 +01:00
Erik Montnemery
d31124d5d4
Avoid creating unneeded Context and Event objects when firing events (#113798)
* Avoid creating unneeded Context and Event objects when firing events

* Add test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-20 09:40:06 +01:00