Commit graph

15462 commits

Author SHA1 Message Date
Allen Porter
4ddcb14053
Add additional CalendarEvent validation (#89533)
Add additional event validation
2023-03-14 20:27:38 -04:00
Jack Boswell
c33ca4f664
Add diagnostics to Starlink (#86328) 2023-03-14 22:24:47 +01:00
Erik Montnemery
c2c809682a
Tweak OTBR tests (#89694) 2023-03-14 21:26:16 +01:00
Ernst Klamer
d1969fd0c2
Add water sensor to bthome (#89595)
* Add water sensor to bthome

* Use TOTAL state class for gas water and energy
2023-03-14 19:26:05 +01:00
epenet
71dc98a39c
Improve hass_ws_client type hint in tests (#89703) 2023-03-14 16:31:40 +01:00
Allen Porter
1bc4802c04
Move local calendar text fixtures to conftest.py (#89674)
* Move local calendar text fixtures to conftest.py

* Apply suggestions from code review

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Add imports for suggested typing fixes

* Apply suggestions from code review

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-14 08:12:44 -07:00
Erik Montnemery
85e0177195
Add WS command for connecting OTBR to a known Thread network (#89692)
* Add WS command for connecting OTBR to a known Thread network

* Add test
2023-03-14 15:28:06 +01:00
Bram Kragten
a213ef2475
Add websocket command to set preferred thread dataset (#89700) 2023-03-14 15:27:31 +01:00
Jan Bouwhuis
ec1b8b616f
Debounce and group MQTT subscriptions (#88862)
* Debounce and group mqtt subscriptions

* Cleanup

* Do not cooldown on resubscribe

* Remove lock from task

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

* ruff

* Longer initial cool down. Manages unsubscribes

* Own lock for access to self._pending_subscriptions

* adjust

* Subscribe to highest QoS when sharing subscription

* do not block _pending_subscriptions_lock with io

* Test the highest qos is subscribed at

* Cleanup max qos

* Follow up comments part 1

* Make docstr more generic

* Make max qos update thread safe

* Add lock on clearing _max_qos when resubscribing

* Wait for linger task

* User copy

* Check for key before cleaning up

* Fix lingering task

* Do not use a lock

* do not await _async_queue_subscriptions

* Replace copy with assignment

* Update max qos before returning

* Do not iterate if max_qos == 0

* Do not ieterate subs if max qos == 0

* Set initial cooldown correctly

* Ensure discovery cooldown ends after subscribing

* plan last subscribe with debouncer timeout

* cooldown if self._pending_subscriptions is set

* Revert format changes

* Remove stale assingnment self._last_subscribe

* Remove not used property

* Also check while for pending subscriptions

* revert first added sleep()

* Optimize

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-14 11:13:55 +01:00
J. Nick Koston
2cb673db04
Handle bytes data in sql sensors (#89169) 2023-03-13 18:07:05 -10:00
G Johansson
afa58b80bd
Default to recorder db for SQL integration (#85436)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-13 17:41:32 -10:00
Erik Montnemery
2f4e9c8ef3
Use otbr domain as dataset source (#89653) 2023-03-13 20:56:09 -04:00
Erik Montnemery
d422b0dcc2
Make OTBR add newly created dataset to thread credential store (#89645) 2023-03-13 14:09:09 -04:00
David Poll
0457bb2717
Add is_hidden_entity test for Jinja templates (#89011) 2023-03-13 18:20:33 +01:00
G Johansson
02389960ce
Refactor Command line sensor to inherit TemplateSensor (#81222)
* Refactor sensor

* Remove not needed

* block until done

* reset test

* test sensor

* Add time
2023-03-13 17:23:25 +01:00
Erik Montnemery
8a0522ca2a
Include extended address in thread discovery data (#89640) 2023-03-13 15:59:22 +01:00
Joakim Sørensen
11e21378b1
Add sensors for supervisor host (#89461)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-03-13 15:39:49 +01:00
epenet
07b25939a2
Use SnapshotAssertion in SFR button tests (#89633) 2023-03-13 15:23:00 +01:00
Thijs Walcarius
cdfb43d403
Address late review comments for frontier_silicon config flow (#89507)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: wlcrs <wlcrs@users.noreply.github.com>
2023-03-13 15:06:45 +01:00
anotherthomas
179cc4d7f7
Improve warnings in mqtt light messages (#89552)
* improved warnings in mqtt light messages.

* fixed tests.
2023-03-13 14:46:16 +01:00
Erik Montnemery
a230732087
Correct naming of some otbr tests (#89631) 2023-03-13 13:56:08 +01:00
epenet
f3da95fb1f
Use SnapshotAssertion in SFR binary sensor tests (#89624) 2023-03-13 13:37:51 +01:00
starkillerOG
6e10cd81dd
Use repair issue when port enable fails in Reolink (#89591)
* Reolink use repair issue for disabled ports

* fix styling

* Add port repair issue tests

* Update homeassistant/components/reolink/strings.json

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-13 11:43:41 +01:00
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
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
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
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
459ea048ba
Fix old indices never being removed with PostgreSQL (#89599) 2023-03-12 14:07:05 -10:00
J. Nick Koston
c41f91be89
Deduplicate entity_id in the states table (#89557) 2023-03-12 10:01:58 -10:00
J. Nick Koston
73cd62bd32
Fix lingering tasks in google_wifi tests (#89571) 2023-03-12 06:39:07 -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
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
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
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
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