Commit graph

60330 commits

Author SHA1 Message Date
David Poll
7284af6a3e
Add an in-memory-preloading loader for Jinja imports (#88850)
* Adds a loader to enable jinja imports.

* Switch to in-memory

* Move loading custom_jinja off of the event loop

* Raise TemplateNotFound if template doesn't exist

* Fix docstring

* Adds a service to reload custom jinja

* Remove IO from test setup

* Improve coverage and small refactor

* Incorporate feedback and use .jinja extension

* Check the loaded sources in test.

* Incorporate PR feedback.

* Update homeassistant/helpers/template.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-13 11:00:05 +01:00
G Johansson
5c4f93fa36
Refactor Command line cover to inherit TemplateEntity (#81214)
* Refactor cover

* Remove not needed
2023-03-13 10:57:30 +01:00
G Johansson
5c42261210
Refactor Command line binary sensor to inherit TemplateEntity (#81212)
* Refactor binary sensor

* Align
2023-03-13 10:56:18 +01:00
epenet
5e73ad9cb0
Use SnapshotAssertion in SFR sensor tests (#89619)
* Use SnapshotAssertion in SFR sensor tests

* Name snapshots

* Cleanup const.py

* Remove name from snapshot
2023-03-13 10:45:59 +01:00
Erik Montnemery
fd5c56fc7d
Rename modules named repairs.py which are not repairs platforms (#89618) 2023-03-13 09:44:20 +01:00
J. Nick Koston
d1ee303e85
Drop duplicated indices from recorder database schema (#89613)
Drop duplicated indices from schema

https://docs.percona.com/percona-toolkit/pt-duplicate-key-checker.html

```
% pt-duplicate-key-checker --databases fresh

ALTER TABLE `fresh`.`events` DROP INDEX `ix_events_event_type_id`;

ALTER TABLE `fresh`.`states` DROP INDEX `ix_states_metadata_id`;

ALTER TABLE `fresh`.`statistics` DROP INDEX `ix_statistics_metadata_id`;

ALTER TABLE `fresh`.`statistics_short_term` DROP INDEX `ix_statistics_short_term_metadata_id`;

```
2023-03-13 09:24:57 +01:00
dougiteixeira
470b0b5471
Adjust Tuya entity naming (#89616)
Fix entity name
2023-03-13 09:23:04 +01:00
dependabot[bot]
e33cb2ee60
Bump actions/cache from 3.3.0 to 3.3.1 (#89617)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 09:10:47 +01:00
Eugenio Panadero
1fb11aec26
Bump aiopvpc to 4.1.0 (#89593) 2023-03-13 09:07:10 +01:00
Stephan Uhle
c45fb85f17
Bump pysml to 0.0.9 (#89603) 2023-03-13 08:25:59 +01:00
Stephan Uhle
17c0e18776
Code quality update for EDL21 (#89561)
Enhance code quality.
2023-03-13 08:04:24 +01:00
J. Nick Koston
e34853a82a
Switch underlying history stats calculation to use seconds (#77857)
* Switch history stats to report in seconds

Because hours were previously used, the data would always be off because
of the loss of resolution when the time being tracked was in a window
of more than 12s

* Apply suggestions from code review

* Update homeassistant/components/history_stats/sensor.py

* tweak
2023-03-12 23:05:48 -04:00
J. Nick Koston
4dcf7c6267
Fix history_stats test failing during DST (#89589)
Note that there is one test that needs `now()` as it is
timezone aware
2023-03-12 23:03:48 -04:00
J. Nick Koston
0575b9bc88
Increase maximum aiohttp connections to 4096 (#89611)
fixes #89408
2023-03-12 16:57:22 -10:00
Barry Loong
877efc993b
Add support for window device class to google assistant (#89564) 2023-03-12 22:45:25 -04:00
J. Nick Koston
b9ac6b4a7c
Improve reliability of context id migration (#89609)
* Split context id migration into states and events tasks

Since events can finish much earlier than states we
would keep looking at the table because states as not
done. Make them seperate tasks

* add retry dec

* fix migration happening twice

* another case
2023-03-12 21:41:48 -04:00
J. Nick Koston
85ca94e9d4
Mark database sessions that do not write data as read_only (#89600)
* Mark sessions that do not write data as read_only

* Mark sessions that do not write data as read_only
2023-03-12 21:33:28 -04:00
J. Nick Koston
977a07de13
Generate large history responses in the executor (#89606) 2023-03-12 21:32:26 -04:00
MarkGodwin
41b4c5532d
Add Update entities to TP-Link Omada integration (#89562)
* Bump tplink-omada

* Add omada firmware updates

* Excluded from code coverage

* Fixed entity name
2023-03-12 21:26:34 -04:00
J. Nick Koston
459ea048ba
Fix old indices never being removed with PostgreSQL (#89599) 2023-03-12 14:07:05 -10:00
J. Nick Koston
e809b636e6
Bump rflink to 0.0.65 for python 3.11 (#89601) 2023-03-12 12:44:47 -10:00
J. Nick Koston
c41f91be89
Deduplicate entity_id in the states table (#89557) 2023-03-12 10:01:58 -10:00
Jan Stienstra
8d88b02c2e
Recode Home Assistant instance name to ascii for Jellyfin (#87368)
Recode instance name to ascii
2023-03-12 13:31:10 -05:00
J. Nick Koston
73cd62bd32
Fix lingering tasks in google_wifi tests (#89571) 2023-03-12 06:39:07 -10:00
Marc Mueller
b4b7605b82
Improve screenlogic generic typing (#89587) 2023-03-12 06:38:26 -10:00
G Johansson
e932139721
Strict typing threshold (#82786) 2023-03-12 17:10:00 +01:00
Erik Montnemery
cf7e500a8e
Support translating entity names (#88242) 2023-03-12 15:55:04 +01:00
Erik Montnemery
376a6eb82a
Convert device_sun_light_trigger test fixture to async (#89578) 2023-03-12 14:48:46 +01:00
Erik Montnemery
234610b1cc
Simplify command_line sensor tests (#89576) 2023-03-12 14:47:43 +01:00
J. Nick Koston
edb06c58fa
Add some more typing to screenlogic (#88522) 2023-03-11 23:04:19 -05:00
J. Nick Koston
84327f203c
Fix flux_led set time to not happen during DST switch (#89559)
* Fix flux_led set time test

If this test was run at the wrong time of the day
it would not have been long enough for the set time
to fire since it only happens at 2:40:30 in the morning
local time

* Revert "Fix flux_led set time test"

This reverts commit 3241912eff.

* Change time set to not be during DST switch
2023-03-11 21:52:17 -05:00
J. Nick Koston
1c57339ec3
Refactor recorder tests to use recorder history API (#89565) 2023-03-11 21:51:16 -05:00
J. Nick Koston
50c31a5355
Move legacy database queries and models to prepare for schema v38 (#89532) 2023-03-11 11:26:30 -10:00
J. Nick Koston
16b420d660
Fix get_significant_states_with_session query looking at legacy columns (#89558) 2023-03-11 10:37:00 -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
Kevin Worrel
56454c8580
Reconnect on any ScreenLogic exception (#89269)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-11 09:27:33 -10:00
Robert Svensson
8564768d9e
UniFi library controls add/update signalling (#89525)
* Library controls add/update signalling

* Remove add/remove signalling

* Remove unifi_entity_base and unifi_client to make mypy pass
2023-03-11 20:14:39 +01:00
Robert Svensson
7487a004fd
Bump pydeconz to v110 (#89527)
* Bump pydeconz to v109

* Bump pydeconz to v110 for additional color modes
2023-03-11 20:13:27 +01:00
J. Nick Koston
52cea16f74
Remove unused code in RecorderRuns.entity_ids (#89526) 2023-03-11 12:46:12 +01:00
J. Nick Koston
01e1221443
Refactor logbook data to use a dataclass (#89534) 2023-03-11 12:45:27 +01:00
rappenze
fccdd7b102
Fix bug in fibaro cover (#89502) 2023-03-11 09:15:05 +01:00
Robert Svensson
288a4203ab
Make client tracker use common UniFi entity class (#84942)
* Make client tracker use common UniFi entity class

* Fix tests

* Fix mypy

* Remove legacy data

* Fix comment: skip else use return

* Minor change

* Remove missed stuff from previous rebase

* Import async_device_available_fn from entities.py rather than specifying it in device_tracker

* Avoid using asserts

* Keep explicit parenthesis for readability

* Allow loading entities on option changes
2023-03-11 06:23:49 +01:00
Paulus Schoutsen
d6a223f0e1
Await block till done inside patched config entry in tests (#89515) 2023-03-10 06:42:53 -10:00
epenet
96bd714364
Add FTTH and WAN info to SFR box diagnostics (#89492)
* Add FTTH and WAN info to SFR box diagnostics

* Adjust tests

* Use snapshots
2023-03-10 10:09:04 -05:00
epenet
74d4a26f97
Add missing mock in jellyfin config flow tests (#89510) 2023-03-10 10:06:53 -05:00
epenet
f22fabdd7f
Add missing mock in kmtronic config flow tests (#89511) 2023-03-10 10:05:31 -05:00
epenet
401273dcff
Add missing mock in lacrosse_view config flow tests (#89512) 2023-03-10 10:05:13 -05:00
epenet
f674559a71
Add missing mock in landisgyr config flow tests (#89513) 2023-03-10 10:04:45 -05:00
Vincent Knoop Pathuis
75bca76e68
Landis+Gyr move coordinator to own file (#89433)
* Move coordinator to own file and add test cases

* Apply typing improvements from review

* Remove testcase for exception during setup

* Simplify unittest for failing serial connection

* Readd checks in serial connection test after review
2023-03-10 15:57:35 +01:00
epenet
029093d0b2
Fix lingering timer in device registry (#89422) 2023-03-10 09:48:58 -05:00