Commit Graph

15718 Commits (34041c75648c6c913785c8dad47376485b646d71)

Author SHA1 Message Date
Nalin Mahajan e290febb38
Bump pyControl4 to 1.1.0 (#90115)
* Bump pyControl4 to 1.1.0

* Remove mock token_expiration from control4
2023-03-23 17:34:38 +01:00
Vincent Knoop Pathuis cb578c71e0
Add Landis+Gyr missing device class (#90182)
Add missing device class for heat_previous_year_gj
2023-03-23 17:21:21 +01:00
PeteRager 73ed6e039a
Improve logging for unavailable sonos hosts (#90172)
* Repeated warning messages on unavailable manually specified hosts

Sonos logs warning messages every 1 minute 12 seconds for hosts that are not on-line.  This fixes the issue and the warning will be logged the first time, and subsequent logs messages will be at DEBUG level

* Update homeassistant/components/sonos/__init__.py

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

* Log info message when reconnect succeeds

* Use pop to simplify code

* Add additional test, fix key error with pop

* Use pop with default return value

* Update tests/components/sonos/test_init.py

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

* Update tests/components/sonos/test_init.py

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

* Update tests/components/sonos/test_init.py

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

* Update tests/components/sonos/test_init.py

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

* Update tests/components/sonos/test_init.py

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

* Update comment, remove unneeded line of code

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-23 16:15:55 +01:00
Vincent Knoop Pathuis 568a731e2d
Use snapshot test for Landis+Gyr (#90126)
Initial commit for snapshot test
2023-03-23 10:30:31 +01:00
Erik Montnemery 50ea0c5cf2
Tweak multiprotocol tests (#90163) 2023-03-23 10:12:42 +01:00
rikroe 1a2fa51ac9
Bump bimmer_connected to 0.13.0 (#90127) 2023-03-23 10:01:01 +01:00
Erik Montnemery 6739542a5d
Simplify some multi pan code (#90135)
* Simplify some multi pan code

* Adjust ZHA config flow
2023-03-23 09:18:35 +01:00
solazs b151923619
Add health mode to gree integration (#89764)
Add health mode to gree integration.
2023-03-23 08:56:47 +01:00
Paulus Schoutsen 12352b2ce1
Always enforce URL param ordering for signed URLs (#90148)
Always enforce URL param ordering
2023-03-22 22:54:09 -04:00
J. Nick Koston ca576d45ac
Cache decode of JWT tokens (#90013) 2023-03-22 16:03:41 -10:00
J. Nick Koston 8a591fa16e
Add auto repairs for events schema (#90136)
* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* fix bug - wrong table
2023-03-22 21:17:36 -04:00
J. Nick Koston 31c988c4f0
Fix index not being dropped on postgresql databases with a schema prefix (#90144)
* Fix index not being dropped on postgresql databases with a schema prefix

Added logging in case index drops fail so we can tell
why in the future

* coverage
2023-03-22 21:03:26 -04:00
J. Nick Koston 99b58f157e
Bump PyJWT to 2.6.0 (#90134)
* Bump PyJWT to 2.6.0

* fix time being frozen too late which makes the access token creation time in the future

* revert zha change

* fix repairs test

* fix ical test
2023-03-22 20:00:47 -04:00
J. Nick Koston 4ebce9746d
Add schema auto repairs for states tables (#90083) 2023-03-22 10:05:23 -10:00
Erik Montnemery 5948347b6b
Fix switch_as_x entity naming (#89992)
* Fix switch_as_x entity naming

* Simplify name logic
2023-03-22 20:24:05 +01:00
Erik Montnemery 1ea3312ed4
Deduplicate multiprotocol addon helper (#90102)
* Deduplicate multiprotocol addon helper

* Clarify
2023-03-22 20:20:42 +01:00
Erik Montnemery 3931e11fd9
Try to load integration before starting option flow (#90111)
* Try to load integration before starting option flow

* Adjust tests
2023-03-22 20:10:10 +01:00
Franck Nijhof 6db8867b81
Update wled to 0.16.0 (#90120) 2023-03-22 13:55:50 -04:00
puddly c581116c82
ZHA network settings API (#88564)
* Rename `zha.api` to `zha.websocket_api`

* Implement a ZHA network settings API

* Use the enum name as the radio type

* Don't filter out ignored config entries

* [WIP] Start unit tests

* Add unit tests

* Rename ZHA websocket API module in `.coveragerc`

* Rename `api` to `websocket_api`

* Increase test coverage to 100%
2023-03-22 11:15:46 -04:00
Erik Montnemery 130c8ea5f5
Update OTRB config entry if REST API port has changed (#90101)
* Update OTRB config entry if REST API port has changed

* Improve test coverage
2023-03-22 14:03:39 +01:00
Erik Montnemery 0ecd043cb2
Add test helper mock_config_flow (#90103) 2023-03-22 08:59:35 -04:00
Paulus Schoutsen 0ca6723378
Allow passing binary to the WS connection (#89882)
* Allow passing binary to the WS connection

* Expand test coverage

* Test non-existing handler

* Allow signaling end of stream using empty payloads

* Store handlers in a list

* Handle binary handlers raising exceptions
2023-03-22 08:36:36 -04:00
Erik Montnemery 19d56a7102
Change error handling in async_process_play_media_url (#90052) 2023-03-22 13:32:02 +01:00
Matrix 87e6dd3949
YoLink flexfob support (#90027) 2023-03-22 12:01:04 +01:00
Jan Bouwhuis 214286acb9
Prepare MQTT platorm tests part1 (#90051)
* Add help_custom_config

* Tests alarm_control_panel

* Tests binary_sensor

* Only use help_custom_config with iterable options
2023-03-22 10:23:08 +01:00
J. Nick Koston 96225bb287
Rename recorder run_history to table_managers.recorder_runs_manager (#90070) 2023-03-21 18:38:33 -10:00
J. Nick Koston 88ad97f112
Fix generating statistics for time periods smaller than we can measure (#90069)
If the time period for the mean/time weighted average was smaller
than we can measure (less than one microsecond), generating
statistics would fail with a divide by zero error. This is likely
only happens if the database schema precision is incorrect.
2023-03-21 21:12:45 -04:00
Michael Hansen 0e7ffff869
Add TTS to pipelines (#90004)
* Add text to speech and stages to pipeline

* Default to "cloud" TTS when engine is None

* Refactor pipeline request to split text/audio

* Refactor with PipelineRun

* Generate pipeline from language

* Clean up

* Restore TTS code

* Add audio pipeline test

* Clean TTS cache in test

* Clean up tests and pipeline base class

* Stop pylint and pytest magics from fighting

* Include mock_get_cache_files
2023-03-21 21:10:31 -04:00
J. Nick Koston ddcaa9d372
Break out statistics repairs into a `auto_repairs` modules (#90068)
* Break out statistics schema repairs into a repairs module

A future PR will add repairs for events, states, etc

* reorg

* reorg

* reorg

* reorg

* fixes

* fix patch targets

* name space rename
2023-03-21 21:08:06 -04:00
Franck Nijhof f98d685154
Refactor WLED select tests (#89219) 2023-03-21 22:32:41 +01:00
Michael d4cc4a343d
Use has_template property from lib in Fritz!SmartHome (#89152) 2023-03-21 21:33:33 +01:00
Jan Bouwhuis 6f88fe93ef
Only publish mqtt_statestream when MQTT is started (#89833)
* Only publish mqtt_statestream when ha is started

* also catch startup states and use event filter

* Add check for MQTT to be available first

* Make sure MQTT is available and started

* Fix test

* Improve test

* Reset mock before assertung not called
2023-03-21 10:21:45 -04:00
Erik Montnemery 41ea8fa9b4
Guess media type when cast is playing media without media type (#90048) 2023-03-21 10:01:35 -04:00
Jan Bouwhuis d865440012
Prepare MQTT common tests part3 (#90022) 2023-03-21 09:19:20 +01:00
Jan Bouwhuis fe49861e26
Prepare MQTT common tests part4 (#90023)
* Upd test_setting_attribute_via_mqtt_json_message

* Update test_setting_attribute_with_template

* Update test_update_with_json_attrs_not_dict

* Update test_update_with_json_attrs_bad_json
2023-03-21 09:07:46 +01:00
epenet dd1700954b
Deprecate YAML in SamsungTV (#89743)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-21 09:00:17 +01:00
Tom Harris 0c0c86bf7b
Add support for new Insteon i3 devcies (#89892) 2023-03-20 21:56:44 -10:00
Jan Bouwhuis 91dbda1ce7
Add mqtt common tests for availability (part2) (#89805)
* update test_availability_when_connection_lost

* Adjust test_availability_without_topic

* Update test_default_availability_payload + helper

* Update test_default_availability_list_payload

* Use helper for async_setup_component

* Update test_default_availability_list_*

* Update test_custom_availability_payload
2023-03-21 08:20:37 +01:00
Arturo 5e5ace9c4e
Add door lock device type to matter integration (#89277)
* Adds base code for matter lock

* Adds basic matter door lock support

* Adds matter lock fixture

* Adds tests for matter lock

* Addresses feedback

* Added logic to handle inter states of matter lock

* Addesses feedback
2023-03-21 01:29:33 +01:00
Raman Gupta cbe85126cb
Introduce a delay between update entity calls (#89737)
* Introduce a delay between update entity calls

* Update homeassistant/components/zwave_js/update.py

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

* move delay to constant and patch

* rename constant

* Switch to async_call_later

* Remove failing test

* Reimplement to solve task problem

* comment

* pass count directly so that value doesn't mutate before we store it

* lines

* Fix logic and tests

* Comments

* Readd missed coverage

* Add test for delays

* cleanup

* Fix async_added_to_hass logic

* flip conditional

* Store firmware info in extra data so we can restore it along with latest version

* Comment

* comment

* Add test for is_running check and fix bugs

* comment

* Add tests for various restore state scenarios

* move comment so it's less confusing

* improve typing

* consolidate into constant and remove unused one

* Update update.py

* update test to unknown state during partial restore

* fix elif check

* Fix type

* clean up test docstrings and function names

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-03-20 18:30:56 -04:00
epenet 18df3a22ca
Add FTTH information to SFR Box (#89781) 2023-03-20 20:06:44 +01:00
Jan Bouwhuis 51b12cbf96
Add user_input as suggested value in imap config flow (#89982)
Add user_input as suggested value to config_schema
2023-03-20 15:52:54 +01:00
Jan Bouwhuis e4275a053c
Remove yaml import from imap integration (#89981)
* Remove yaml import from imap integration

* Cleanup sensor code and strings.json
2023-03-20 15:52:07 +01:00
Malte Franken 0bf652ca96
Refactor constants in geo_json_events integration (#89912)
move constants to separate file
2023-03-20 13:26:38 +01:00
J. Nick Koston 146a31163c
Use bluetooth address instead of uuid on MacOS (#89926) 2023-03-20 12:07:41 +01:00
J. Nick Koston c3043fb0ee
Bump bluetooth deps for bleak 0.20 (#89925)
Co-authored-by: K <z@kwi.li>
2023-03-20 12:06:15 +01:00
epenet 9a784fddef
Fail CI on lingering timers (#89292) 2023-03-20 10:20:19 +01:00
J. Nick Koston d33a303a83
Fix statistics schema µs precision auto repair being ineffective (#89902)
If a user manually migrated their database to MySQL or PostgresSQL
and incorrectly created the timestamp columns as float we would
fail to correct them to double because when we migrated to use
timestamps for the columns I missed that we needed to change the
columns and types for µs precision
2023-03-20 00:06:37 -04:00
J. Nick Koston e798c30b8b
Fix statistics schema auto repair when there is bad data (#89903)
- If the user had previously duplicated data we could end up
  picking the next metadata_id and there could be stale rows
  in the database that have that metadata_id. This can only happen
  from bad manual migrations (which is what this is function
  is validating in the first place). To solve this we now insert
  data with a future date and look at the latest inserted row
  instead of the first.

Example
```
['stored_statistics',
  defaultdict(<class 'list'>,
              {'recorder.db_test_schema': [{'end': 948589200.0,
                                            'last_reset': None,
                                            'max': None,
                                            'mean': 2021.0,
                                            'min': None,
                                            'start': 948585600.0,
                                            'state': None,
                                            'sum': 394.5068},
                                          {'end': 1601946000.000001,
                                            'last_reset': 1601942400.000001,
                                            'max': 1.000000000000001,
                                            'mean': 1.000000000000001,
                                            'min': 1.000000000000001,
                                            'start': 1601942400.000001,
                                            'state': 1.000000000000001,
                                            'sum': 1.000000000000001}]})]
```
2023-03-20 00:06:23 -04:00
Allen Porter 9721ba59b6
Rewrite the calendar trigger to fix potential bugs (#89918)
Update the calander event trigger logic to have more exhaustive coverage. The
trigger will now use a timespan to create an explicit window for considering
upcoming events. The start/end of the time span is now more explicit, rather
than getting it from the alarm time.

The trigger is now broken into composable pieces:
- A timespan object for more explicitly managing the time window
- A function to get events during a time span
- A function to process upcoming events and determine the trigger times

The existing listener is now just responsible for scheduling alarms and glue.

This fixes bug with DST handling where the conversion back and forth between
UTC and timezone ends up dropping events during the jump forward. In practice,
an event was returned from the scanning, but it was never fired by the trigger
because (1) it was filtered out of the interval and (2) the event list was
previously cleared every iteration so it would get dropped.

Future improvements can bake more invariant checking into this structure.
2023-03-19 23:42:12 -04:00
Jan Bouwhuis 2039955ef7
Fix imap_email_content unknown status and replaying stale states (#89563) 2023-03-19 17:35:45 -10:00
J. Nick Koston c94b054d75
Retain history when renaming an entity_id (#89963)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-19 17:33:21 -10:00
J. Nick Koston aebe4c66a6
Fix cpu thrashing during purge after all legacy events were removed (#89923)
* Fix cpu thrashing during purge after all legacy events were removed

We now remove the the index of of event ids on the states table when its
all NULLs to save space. The purge path needs to avoid checking for legacy
rows to purge if the index has been removed since it will result in a full
table scan each purge cycle that will always find no legacy rows to purge

* one more place

* drop the key constraint as well

* fixes

* more sqlite
2023-03-19 22:04:24 -04:00
J. Nick Koston 5ffb233004
Avoid database executor job to fetch statistic metadata on cache hit (#89960)
* Avoid database executor job to fetch statistic metadata on cache hit

Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job

* Avoid database executor job to fetch statistic metadata on cache hit

Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job

* Avoid database executor job to fetch statistic metadata on cache hit

Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job

* remove exception catch since the threading.excepthook will actually catch this in production

* fix a few missed ones

* threadsafe

* Update homeassistant/components/recorder/table_managers/statistics_meta.py

* coverage and optimistic caching
2023-03-19 22:01:16 -04:00
Matthias Alphart 557b9c7d51
Add KNX interface device with diagnostic entities (#89213) 2023-03-19 02:13:52 -11:00
epenet 0e7bd401f2
Fix lingering timer in config entry flow tests (#89853) 2023-03-19 08:56:24 +01:00
Vincent Knoop Pathuis 6ad9f420ab
Add Landis+Gyr poll on restart (#89644) 2023-03-18 08:50:50 -11:00
J. Nick Koston b1f64de6ce
Remove the old ix_states_event_id index if its no longer being used (#89901)
* Remove the old ix_states_event_id index if its no longer being used

* cover it

* fixes

* fixup

* Update homeassistant/components/recorder/tasks.py
2023-03-17 20:27:33 -04:00
J. Nick Koston 138bbd9c28
Use json_loads_object util in backup (#89895)
* Use json_loads_object util in backup

* adjust test
2023-03-17 20:25:29 -04:00
epenet ab6e929443
Fix EntityComponent lingering timer in helper tests (#89801)
* Fix lingering timer in entity platform tests

* Tweak

* Fix entity and entity_component also

* Remove async_shutdown

* Adjust

* Adjust
2023-03-17 10:26:05 +01:00
epenet abd91dd934
Ensure MockEntityPlatform shuts down after tests (#89849) 2023-03-17 10:22:43 +01:00
epenet ab4a726e6c
Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
J. Nick Koston f6f3565796
Reduce latency to find stats metadata (#89824) 2023-03-16 19:00:02 -10:00
Allen Porter 04a99fdbfc
Add local calendar diagnostics platform (#89776)
* Add local calendar diagnostics platform

* Use redaction from ical

* Update diagnostics for new ical version

* Apply suggestions from code review

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

* Use snapshot tests for local calendar diagnostics

* Setup diagnostics directly in tests rather than via dependencies

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-16 23:05:01 -04:00
Erik Montnemery ae127e7687
Change light white service call attribute to accept True (#89803) 2023-03-16 23:02:56 -04:00
epenet 79c9447770
Fix lingering timer in event helper tests (#89819)
Fix lingering timer in event tests
2023-03-16 23:01:23 -04:00
epenet ff8b91aeea
Add freezer to known test fixtures in pylint (#89825)
Add freezer to known fixtures in pylint
2023-03-16 22:39:41 -04:00
Michael Hansen e16f17f5a8
Voice assistant integration with pipelines (#89822)
* Initial commit

* Add websocket test tool

* Small tweak

* Tiny cleanup

* Make pipeline work with frontend branch

* Add some more info to start event

* Fixes

* First voice assistant tests

* Remove run_task

* Clean up for PR

* Add config_flow.py

* Remove CLI tool

* Simplify by removing stt/tts for now

* Clean up and fix tests

* More clean up and API changes

* Add quality_scale

* Remove data from run-finish

* Use StrEnum backport

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-16 20:42:26 -04:00
epenet 81c0382e4b
Fix lingering timer in bootstrap tests (#89790)
* Fix lingering timer in bootstrap test

* Adjust comment

* Use a constant
2023-03-16 17:20:27 -04:00
epenet 9893b1cf4a
Cleanup get_local_ip in global conftest (#89826) 2023-03-16 22:03:06 +01:00
Franck Nijhof f9919bb7cf
Add pre-defined entity name translations (#89792) 2023-03-16 21:10:20 +01:00
epenet 69aa3a75c5
Fix lingering timer in event sun tests (#89808) 2023-03-16 18:32:34 +01:00
epenet 1a7e316b51
Fix lingering timer in condition tests (#89807) 2023-03-16 18:19:29 +01:00
Jan Bouwhuis 6e25abfdcc
Fix typo in docstr (#89804) 2023-03-16 16:54:26 +01:00
Erik Montnemery 9384ec18f8
Add filters to climate and light service descriptions (#86162)
* Add filters to climate and light service descriptions

* Allow specifying enums directly

* Update service descriptions

* Adjust test

* Cache entity features

* Lint

* Improve error handling, add list of known base components

* Don't allow specifying an entity feature as int
2023-03-16 15:59:51 +01:00
Jan Bouwhuis c81a38effb
Mqtt prepare test base part1 (#89796)
* Refactor test_reloadable

* Refactor test_disabling_and_enabling_entry

* optimize test_unload_config_entry

* Cleanup help_test_unload_config_entry

* cleanup test_unload_entry

* Update test tls_version

* More tests to entry only

* Add validate and hassconfig patch

* Revert fixture changes patch_hass_config

* Follow up comments
2023-03-16 15:57:01 +01:00
Erik Montnemery 886c2635ad
Add support for constant selector (#89573)
* Add support for constant selector

* Adapt to frontend PR changes
2023-03-16 09:02:26 -04:00
epenet c6568ffb62
Fix lingering timer in collection helper tests (#89793)
* Fix lingering timer in collection helper tests

* One more
2023-03-16 08:38:22 -04:00
Franck Nijhof f32b7859b8
Restructure translations for entity components (#89702) 2023-03-16 12:16:08 +01:00
Erik Montnemery f55aaf7664
Drop unused Google entity settings from cloud (#89786) 2023-03-16 11:15:38 +01:00
Vincent Knoop Pathuis 273d794f7a
Add device class for Landis+Gyr GJ energy sensor (#89522) 2023-03-16 11:12:05 +01:00
epenet 46a5aa71ec
Add type hints to helper tests (#89784) 2023-03-16 11:10:56 +01:00
epenet 69e85b3216
Fix SFR Box diagnostics (#89783) 2023-03-16 11:09:54 +01:00
epenet fec6236dd9
Add type hints to root tests (#89785) 2023-03-16 11:08:47 +01:00
epenet 8a58457203
Fix lingering timer in config entries test (#89787) 2023-03-16 11:07:42 +01:00
epenet 913156b0e0
Avoid lingering timer on script shutdown (#89753) 2023-03-16 08:00:21 +01:00
J. Nick Koston 99d6b1fa57
Migrate States to use a table manager (#89769) 2023-03-15 16:19:43 -10:00
J. Nick Koston 4080d68489
Fix logbook tests failing because time was not url encoded correctly (#89770) 2023-03-15 15:29:41 -10:00
J. Nick Koston e379aa23bd
Migrate StateAttributes to use a table manager (#89760)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-15 15:26:29 -10:00
J. Nick Koston ccab45520b
Remove asyncio.coroutine workarounds (#88560) 2023-03-15 20:04:31 -04:00
J. Nick Koston aec2d63302
Add keep_days to recorder.purge_entities (#89726) 2023-03-15 11:13:47 -10:00
epenet 3aa5629665
Improve type hints in condition helper tests (#89754) 2023-03-15 19:42:23 +01:00
Michael d4edec2863
Move calculation of current value into lib in Fritz!SmartHome (#89150) 2023-03-15 18:59:03 +01:00
Marcel van der Veldt fceb208381
Abort Hue config flow if bridge can not be reached (#88893)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-03-15 18:55:34 +01:00
starkillerOG 4eee626770
Reolink check firmware (#88903) 2023-03-15 18:54:28 +01:00
epenet 54ad8b8ee9
Avoid lingering timers in update coordinator tests (#89749) 2023-03-15 18:50:32 +01:00
epenet c416d18506
Add WAN information to SFR Box (#89678) 2023-03-15 18:49:57 +01:00
epenet 35c02ddc81
Add type hints to update coordinator tests (#89748) 2023-03-15 18:07:43 +01:00
Allen Porter b588b8b215
Bump ical to 4.5.0 (#89744) 2023-03-15 18:06:46 +01:00
J. Nick Koston a244749712
Make StatesMetaManager thread-safe when an entity_id is fully deleted from the database and than re-added (#89732)
* refactor to make StatesMetaManager threadsafe

* refactor to make StatesMetaManager threadsafe

* refactor to make StatesMetaManager threadsafe

* refactor to make StatesMetaManager threadsafe

* reduce

* comments
2023-03-15 08:54:02 -04:00
epenet 6270776fbb
Add turn_on trigger to Samsung TV (#89018)
* Add turn_on trigger to Samsung TV

* Add tests

* Apply suggestions from code review

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

* Remove assert

* Cleanup mock_send_magic_packet

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-03-15 12:43:53 +01:00
jan iversen cd23caff58
Correct modbus serial method parameter (#89738) 2023-03-15 12:27:45 +01:00
epenet 9719f817c0
Bump ruff to 0.0.256 (#89734) 2023-03-15 10:07:12 +01:00
Allen Porter a91055cc2a
Fix additional typing in local calendar tests (#89704)
* Fix additional typing in local calendar tests

* Update tests/components/local_calendar/test_calendar.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-14 19:33:46 -07:00
J. Nick Koston b906d67c1e
Fix filtered purge not removing newer events (#89721) 2023-03-14 16:33:19 -10:00
Penny Wood 858fc30fcd
Fix infinite loop in sun.sun (#89723) 2023-03-14 16:27:29 -10:00
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
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 a0f725dfcb
Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
Thijs W b8bda93d87
Add config flow to frontier_silicon (#64365)
* Add config_flow to frontier_silicon

* Add missing translation file

* Delay unique_id validation until radio_id can be determined

* Fix tests

* Improve tests

* Use FlowResultType

* Bump afsapi to 0.2.6

* Fix requirements_test_all.txt

* Stash ssdp, reauth and unignore flows for now

* Re-introduce SSDP flow

* hassfest changes

* Address review comments

* Small style update

* Fix tests

* Update integrations.json

* fix order in manifest.json

* fix black errors

* Apply suggestions from code review

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

* Address review comments

* fix black errors

* Use async_setup_platform instead of async_setup

* Address review comments on tests

* parameterize tests

* Remove discovery component changes from this PR

* Address review comments

* Apply suggestions from code review

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

* Add extra asserts to tests

* Restructure _async_step_device_config_if_needed

* Add return statement

* Update homeassistant/components/frontier_silicon/media_player.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-10 10:26:03 +01:00
Erik Montnemery fde205c158
Add unconfigured flag to thread discovery data (#89230)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-09 22:32:32 -05:00
epenet f8462fd5b7
Add missing mock in guardian config flow tests (#89451) 2023-03-09 22:57:16 +01:00
Lucas Mindêllo de Andrade eed16dc185
Add list areas function to template (#88441) 2023-03-09 22:32:30 +01:00
epenet 48fca3bb27
Fix missing debouncer cancel in update coordinator (#89383)
* Fix missing debouncer cancel in update coordinator

* Improve

* Adjust with comment

* Adjust again

* Simplify PR

* Adjust tests to avoid lingering timer

* Improve
2023-03-09 15:16:52 -05:00
Joakim Sørensen 4f29e1e180
Add stats sensors for core and supervisor (#89455)
* Add stats sensors for core and supervisor

* Update homeassistant/components/hassio/__init__.py
2023-03-09 19:06:35 +01:00
epenet 3a4ce260b4
Add missing mock in freedompro config flow tests (#89442) 2023-03-09 19:05:23 +01:00
epenet f3084165b1
Add missing mock in filesize config flow tests (#89441) 2023-03-09 19:04:51 +01:00
epenet 4e4608183e
Add missing mock in fibaro config flow tests (#89440) 2023-03-09 19:04:07 +01:00
epenet adfd263635
Add missing mock in gree config flow tests (#89450) 2023-03-09 18:12:22 +01:00
Stefan Agner f903c536fb
Add Hardkernel ODROID-M1 (#89431)
* Add Hardkernel ODROID-M1

Add Hardkernel ODROID-M1 machine. ODROID-M1 is a Rockchip RK3568B2 SoC
based single board computer with 4xCortex-A55, NVMe support and up to
8GB of RAM.

* Update homeassistant/components/hardkernel/hardware.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Fix tests

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-09 14:18:19 +01:00
epenet dcff2f37f7
Add DSL prefix to SFRBox ADSL sensors (#89276) 2023-03-09 13:19:22 +01:00
epenet 4a082403eb
Add missing mock in coronavirus config flow tests (#89428) 2023-03-09 13:16:36 +01:00
epenet b0631fed1d
Add missing mock in braviatv config flow tests (#89419) 2023-03-09 13:05:32 +01:00
epenet 9faf251321
Add missing mock in buienradar config flow tests (#89420) 2023-03-09 13:05:04 +01:00
TheJulianJES 3989ef8863
Parse attribute reports for ZHA select entity (#89418)
* Parse attribute reports for ZHA select entity

* Add test for checking that select entity attribute reports are parsed
2023-03-09 07:01:18 -05:00
Jan Bouwhuis 1a4b14c217
Fix MQTT rgb light brightness scaling (#89264)
* Normalize received RGB colors to 100% brightness

* Assert on rgb_color attribute

* Use max for RGB to get brightness

* Avoid division and add clamp

* remove clamp

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-09 08:02:59 +01:00
Joakim Sørensen e5ce8e920d
Add paths for add-on changelog and documentation (#89411) 2023-03-08 20:23:33 -05:00
J. Nick Koston 170a13302c
Reduce overhead to store context ids in the database (#88942) 2023-03-08 14:51:45 -10:00
Matthias Alphart bfae8992a9
Better log message for KNX expose conversion error (#89400) 2023-03-08 22:42:07 +01:00
Jan Bouwhuis 366baef7f6
Allow enum as MQTT sensor device_class (#89391) 2023-03-08 22:35:06 +01:00
J. Nick Koston e1d62b554a
Migrate integration_platform helper to use async_get_integrations (#89303)
* Migrate integration_platform helper to use async_get_integrations

We were fetching integrations inside the gather one
at a time. This is inefficent.

* cleanup

* cleanup

* add task name

* small tweaks

* gather only if we have tasks
2023-03-08 16:01:47 -05:00
J. Nick Koston 5dbab21f9a
Fix missing f-string in filterable_job (#89340)
* Fix missing f-string in filterable_job

* remove bad test
2023-03-08 15:53:48 -05:00
Erik Montnemery 09915f8047
Add WS API for getting an OTBR's extended address (#89384)
* Add WS API for getting an OTBR's extended address

* Bump python-otbr-api to 1.0.8

* Really add require_admin decorator to otbr WS API
2023-03-08 15:52:53 -05:00
J. Nick Koston cefba7c638
Avoid falling back to listening for all states when a template render raises an exception (#89392)
When a template render raised an exception we would start listening for
all states until the template did not raise an exception anymore. This
was not needed since the entity that is causing the exception was
already in the tracker.

Re-rendering on all state changes can be extremely expensive and can
bring an instance into a sluggish or unresponsive state when updating
from a much older version that did not raise ValueError when a default
was missing.
2023-03-08 15:50:34 -05:00
parliament119 7d97653895
Bump pyfritzhome to 0.6.8 and add support for Non-Color-Bulbs (#89141) 2023-03-08 18:24:37 +01:00
Erik Montnemery 18cb53a35c
Pass hass instance when validating templates (#89242)
* Pass hass instance when validating templates

* Update tests

* Fix validating templates without hass

* Update service tests
2023-03-08 11:28:53 -05:00
epenet 7982f713e1
Fix lingering tasks in plex (#89282)
* Cleanup expected_lingering_tasks in plex

* Adjust
2023-03-08 10:53:08 -05:00
epenet 3e2ee7cd11
Add missing mock in aemet config flow tests (#89360) 2023-03-08 10:18:44 -05:00
epenet 33906059d3
Add missing mock in airq config flow tests (#89364) 2023-03-08 10:18:31 -05:00
epenet 3a40f5f35b
Add missing mock in airvisual_pro config flow tests (#89362) 2023-03-08 15:18:24 +00:00
epenet 23698eb99f
Add missing mock in agent_dvr config flow tests (#89361) 2023-03-08 15:18:17 +00:00
epenet 959c2205d5
Add missing mock in airvisual config flow tests (#89359) 2023-03-08 10:18:07 -05:00
epenet b61ad43144
Add missing mock in amber config flow tests (#89358) 2023-03-08 10:17:45 -05:00
epenet f4572a2e1c
Add missing mock in atag config flow tests (#89356) 2023-03-08 10:16:51 -05:00
epenet ea6a95176d
Add missing mock in azure event hub config flow tests (#89355) 2023-03-08 10:16:28 -05:00
Franck Nijhof feb3f543be
Improve Supervisor API handling (#89379) 2023-03-08 15:21:11 +01:00
epenet 30884f6d17
Add missing mock in axis config flow tests (#89365) 2023-03-08 09:38:55 +01:00
epenet adb4414440
Add missing mock in brother config flow tests (#89354) 2023-03-08 08:43:07 +01:00
puddly fa128fbcec
Clean ZHA radio path with trailing whitespace (#89299)
* Clean config flow entries with trailing whitespace

* Rewrite the config entry at runtime, without upgrading

* Skip intermediate `data = config_entry.data` variable

* Perform a deepcopy to ensure the config entry will actually be updated
2023-03-07 20:24:08 -05:00
J. Nick Koston bde40cde48
Fix thread diagnostics loading blocking the event loop (#89307)
* Fix thread diagnostics loading blocking the event loop

* patch target
2023-03-07 20:21:26 -05:00
starkillerOG 2d3c5cf8ee
Reolink test init 100% (#89112)
* Split out reolink tests

* Bring __init__ coverage to 100%

* Improve docstrings

* Use patching and autospec=True for ReolinkHost

* Use fixture

* fix styling

* Parametrize tests

* Update tests/components/reolink/conftest.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update test_config_flow.py

* convert to fixture

* review comments

* Update tests/components/reolink/conftest.py

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

* Update tests/components/reolink/conftest.py

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

* Update tests/components/reolink/conftest.py

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

* fix tests

* fix imports

* Update test_init.py

* Check if host is logout on reload

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-07 20:29:38 +01:00