Commit Graph

20220 Commits (b644c03fa743d0a022607a650facf0e75102aad7)

Author SHA1 Message Date
Jan Bouwhuis 012291a1f3
Fix google_asssistant sensor state reporting (#112838)
* Fix post google_assistant sensor values as float not string

* Fix aqi reporting and improve tests

* Fix _air_quality_description_for_aqi and  test
2024-03-12 09:07:20 +01:00
Erik Montnemery d039bd654b
Add reconfigure flow to homeworks (#112419)
* Add reconfigure flow to homeworks

* Fix tests

* Use async_update_reload_and_abort helper

* Try to fix test shutdown
2024-03-12 08:47:44 +01:00
Thomas55555 4f4391bd09
Add missing device info to Husqvarna Automower (#113090)
* Add missing DeviceInfo to Husqvarna Automower

* add a test

* Adress review

* Update homeassistant/components/husqvarna_automower/entity.py

* fix url

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-03-12 08:25:35 +01:00
definitio 6f19744469
Add A6 family code for DS2438 1-Wire sensor (#112844)
* Add A6 family code for DS2438

* Add tests

* Fix switch

* Apply code review suggestion

* Add comments
2024-03-12 08:06:02 +01:00
J. Nick Koston 3f72fae60b
Migrate remaining call in check_config helper to use async_get_component (#113123) 2024-03-11 15:56:24 -10:00
J. Nick Koston 17b202d8cf
Await discovery_function in the DiscoveryFlowHandler instead of wrapping it in a task (#113115)
Await discovery_function in the DiscoveryFlowHandler instead of wrapping

This function was always a coro so it can be awaited
directly instead of wrapping it in add_job
2024-03-11 21:37:03 -04:00
J. Nick Koston 6e59d1cb29
Migrate homekit to use async_at_started (#113102) 2024-03-11 20:08:02 -04:00
J. Nick Koston 620433a79d
Run coroutines as eager tasks in async_run_hass_job (#111683)
* Run coroutines as eager tasks in async_run_hass_job

Note that this does not change async_add_hass_job

Do not merge this. For test run only

* Phase out periodic tasks

* false by default or some tests will block forever, will need to fix each one manually

* kwarg works

* kwarg works

* kwarg works

* fixes

* fix more tests

* fix more tests

* fix lifx

* opensky

* pvpc_hourly_pricing

* adjust more

* adjust more

* smarttub

* adjust more

* adjust more

* adjust more

* adjust more

* adjust

* no eager executor

* zha

* qnap_qsw

* fix more

* fix fix

* docs

* its a wrapper now

* add more coverage

* coverage

* cover all combos

* more fixes

* more fixes

* more fixes

* remaining issues are legit bugs in tests

* make tplink test more predictable

* more fixes

* feedreader

* grind out some more

* make test race safe

* limit first scope to triggers

* one more

* Start tasks eagerly in for async_at_start(ed)

A few of these can avoid being scheduled on the loop
during startup

* fix cloud

* Revert "fix cloud"

This reverts commit 5eb3ce695d.

* fix test to do what start does

* flip flag

* flip flag

* Fix here_travel_time creating many refresh requests at startup

- Each entity would try to refresh the coordinator which
  created many tasks. Move the refresh to a single
  async_at_started

- The tests fired the EVENT_HOMEASSISTANT_START event
  but the code used async_at_started which only worked
  because the tests did not set CoreState to not_running

* fix azure

* remove kw

* remove kw

* rip

* cover

* more rips

* more rips

* more rips
2024-03-11 20:05:08 -04:00
J. Nick Koston 53c3e27ed9
Add support for run_immediately to async_listen_once (#113020) 2024-03-11 13:51:03 -10:00
J. Nick Koston 6ff8d7d2b9
Make sonos ssdp discovery callback a callback function (#113107) 2024-03-11 13:50:04 -10:00
J. Nick Koston 77cdecf0f1
Migrate async_run_job to use eager_start for tasks (#113011) 2024-03-11 11:30:46 -10:00
J. Nick Koston e29b012eba
Fix failing google diagnostics test (#113095) 2024-03-11 11:05:49 -10:00
J. Nick Koston 324266a4e6
Fix race in script stop that could cause async_stop to hang forever (#113089) 2024-03-11 10:48:11 -10:00
Steven B eff0aac586
Ensure that the ring integration always raises HomeAssistantError for user actions (#109893)
* Wrap library exceptions in HomeAssistantErrors

* Remove commented

* Update post review

* Update post second review
2024-03-11 20:23:49 +01:00
Paulus Schoutsen 145657dc21
Only load services.yaml for integrations that have it (#112732)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-11 19:05:32 +01:00
Joost Lekkerkerker c75342bd9a
Improve lists in integrations [C-D] (#113072) 2024-03-11 18:58:35 +01:00
Joost Lekkerkerker 690ba103ed
Improve lists in integrations [A] (#113006)
* Use list comprehension [A]

* Use list comprehension [A]

* Update homeassistant/components/aws/notify.py
2024-03-11 16:17:44 +01:00
Joost Lekkerkerker bf40b33117
Remove fixtures from global fixtures folder (#113060)
Remove fixtures
2024-03-11 10:19:54 -04:00
J. Nick Koston d939c48b4a
Fix here_travel_time creating many refresh requests at startup (#113041) 2024-03-11 15:11:33 +01:00
Marcel van der Veldt 0eb1adccf8
Fix for Hue not applying effect in scene (#113057) 2024-03-11 15:08:00 +01:00
Joost Lekkerkerker 2792a5f016
Enable even more SIM ruff rules (#113017)
* SIM202 SIM211 SIM220 SIM221 SIM222 SIM223

* SIM910 SIM911

* SIM

* Update homeassistant/components/mqtt/siren.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Update homeassistant/components/mqtt/siren.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-03-11 14:23:52 +01:00
Steven B 48cb09a4a8
Prepare ring update service for deprecation (#108781)
* Prepare ring update service for deprecation

* Update service removal release number
2024-03-11 13:42:52 +01:00
Joost Lekkerkerker f8d1232598
Move HomematicIP Cloud fixture to integration test (#112987)
* Move HomematicIP Cloud fixture to integration test

* Update tests/components/homematicip_cloud/helper.py

* Update tests/components/homematicip_cloud/helper.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-03-11 13:26:44 +01:00
Shai Ungar 3c06fbbd82
Add ConfigFlow for seventeentrack integration (#111196)
* Add config flow to 17Track

* Import config from configuration.yaml

* 1. move import to async_setup_platform
2. add USERNAME (email) in title for uniqueness

* Add options flow

* Add tests

* Add CONF_SHOW_ARCHIVED  and CONF_SHOW_DELIVERED to data from options

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/manifest.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* 1. Added repair issues
2. _async_validate_input inlined
3. added unique id
4. take default scan interval

* fix

* 1. move async_create_issue to async_setup_platform
2. fix tests
3. black + pylint

* combine USER_SCHEMA and OPTIONS_SCHEMA

* small fix

* remove async_setup

* fix tests and add 100% coverage

* 1. remove CONFIG_SCHEMA
2. remove error log
3. add issue with more description when import issues happen
4. some linting

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use freezer
use AsyncMock
fix tests

* add test_flow_fails
parametrize tests where needed
test_import_flow_already_configured - where a unique id already configured (abort flow)

* lint

* fix rebase issues

* some more fix

* 17Track revert tests and put them in a different PR

* adapt tests to MockConfigEntry

* Update tests/components/seventeentrack/test_sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. create fixture for config and another with options
2. set options with default values
3. remove CONFIG_SCHEMA

* Update tests/components/seventeentrack/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/seventeentrack/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. get options from import data and default if not present
2. rename mock_config_entry_no_options -> mock_config_entry_with_default_options

* move ACCOUNT_ID to mock_seventeentrack_api.return_value.profile.account_id

* Apply suggestions from code review

* Update tests/components/seventeentrack/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>
2024-03-11 12:47:39 +01:00
Marcel van der Veldt a7a30581fc
Fix adding Hue bridge manually by IP (#113055) 2024-03-11 12:35:41 +01:00
Sid c60aed3012
Bump webmin-xmlrpc to 0.0.2 (#113004) 2024-03-11 11:44:21 +01:00
Joost Lekkerkerker 3b0b729557
Remove YAML configuration from WAQI (#113027) 2024-03-11 11:41:49 +01:00
Joost Lekkerkerker 2349ce1abd
Move yandex transport fixture to integration test (#112988)
* Move yandex transport fixture to integration test

* Update tests/components/yandex_transport/test_sensor.py

* Ran ruff

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-03-11 11:28:30 +01:00
Brett Adams 6d440e36ad
Add tests for Aussie Broadband diagnostics (#113049)
* Add tests for diag

* Fix docstring

* Spelling
2024-03-11 10:54:12 +01:00
Simone Chemelli 4095de0566
Allow Shelly CoAP to honour default network adapter (#110997)
* Allow Shelly CoAP to honor default network adapter

* apply review comment

* 1 more debug log line

* adapt code to library changes

* test

* improve test

* one more test
2024-03-11 09:52:15 +01:00
J. Nick Koston 30c3174498
Fix CoreState in cloud google assistant tests (#113045) 2024-03-10 22:50:09 -10:00
J. Nick Koston fd8ee6c857
Fix google assistant cloud sync test (#113044) 2024-03-10 22:44:21 -10:00
Yuxin Wang 405bf076b2
Remove a redundant check in APCUPSD's config flow (#113032)
Remove a redundant check that is impossible to happen in practice
2024-03-11 08:38:44 +01:00
Joost Lekkerkerker b914ac3185
Move openhardwaremonitor fixture to integration tests (#112982)
* Move openhardwaremonitor fixture

* Update tests/components/openhardwaremonitor/test_sensor.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-03-11 08:30:22 +01:00
J. Nick Koston 3387892f59
Schedule tasks eagerly when called from hass.add_job (#113014) 2024-03-10 21:19:49 -10:00
Joost Lekkerkerker cede16fc40
Move Feedreader fixture to integration test (#112989) 2024-03-10 23:27:38 -04:00
Joost Lekkerkerker d528378f5d
Move london_air fixture to integration test (#112991)
* Move london_air fixture to integration test

* Fix
2024-03-10 23:27:20 -04:00
Joost Lekkerkerker 812bd4af65
Move metoffice fixture to integration test (#112992)
* Move metoffice fixture to integration test

* Fix

* Update tests/components/metoffice/test_config_flow.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Fix

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-03-10 23:27:00 -04:00
Joost Lekkerkerker a78e389d9b
Move Microsoft face fixture to integration test (#112993)
* Move Microsoft face fixture to integration test

* Update tests/components/microsoft_face/test_init.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Fix

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-03-10 23:26:37 -04:00
Joost Lekkerkerker cddce0ce0d
Enable more SIM ruff rules (#113015)
* SIM101 SIM103

* SIM107 SIM109

* SIM110

* SIM112 SIM113

* SIM115

* SIM116

* Fix

* Fix

* Fix
2024-03-10 23:20:37 -04:00
J. Nick Koston 7ea79148ba
Ignore logging events in zha websocket tests (#113031) 2024-03-10 13:13:26 -10:00
Yuxin Wang db31afe019
Migrate APCUPSD to has entity name (#112997)
* Properly set entity names for APCUPSD

* Add test cases to prevent future regressions

* Fix tests due to the updated entity IDs

* Prettify code

* Remove redundant translation key
2024-03-10 23:56:25 +01:00
Thomas55555 9a647d9b17
Bump aioautomower to 2024.3.0 (#112627)
Fix error in Husqvarna automower in Zones dataclass
2024-03-10 23:10:27 +02:00
Joost Lekkerkerker d9f6e4be24
Add icon translations to Husqvarna automower (#111727)
* Add icon translations to Husqvarna automower

* fix
2024-03-10 21:55:31 +01:00
Jan Bouwhuis 02ef7ba134
Remove not needed hass.async_block_till_done in test (#113002) 2024-03-10 09:46:25 -10:00
Joost Lekkerkerker 958c843512
Move OpenALPR cloud fixture to integration test (#112994) 2024-03-10 15:17:24 -04:00
Joost Lekkerkerker d76c20a483
Move uk_transport fixture to integration test (#112995) 2024-03-10 15:17:06 -04:00
Joost Lekkerkerker 65e1502b50
Move wsdot fixture to integration test (#112996) 2024-03-10 15:12:29 -04:00
J. Nick Koston afa69cca38
Import custom components in the executor by default (#112177)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-03-10 08:41:33 -10:00
J. Nick Koston a2318c26c9
Run debouncer tasks eagerly to avoid scheduling on the event loop (#112789) 2024-03-10 08:37:10 -10:00
Jan Bouwhuis c608d1cb85
Fix mqtt platform setup race (#112888) 2024-03-10 08:36:17 -10:00
Shai Ungar eb81bf1d49
Improve 17track tests (#112734)
* 17Track tests

* add 17Track sensor to coverage

* extract repeated code

* 1. _goto_future - call tick only once
2. change test name to reflect test
3. remove ifs from test

* remove undersocre from _goto_future
2024-03-10 18:57:28 +01:00
Ernst Klamer e91a38eede
Add Locks to Xiaomi-BLE (#111156) 2024-03-09 22:29:48 -10:00
A Björck e631224372
Bump yalexs to 2.0.0 (#111706)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-09 22:11:10 -10:00
Robert Svensson ffcbab1c20
Split out deCONZ hub (#112854)
* Rename DeconzGateway to DeconzHub

* Move gateway.py to hub/hub.py
2024-03-10 08:25:12 +01:00
J. Nick Koston f1b5dcdd1b
Refactor handling of device updates in ESPHome (#112864) 2024-03-09 20:30:17 -10:00
J. Nick Koston 60bddc2861
Schedule coroutine functions eagerly when async_listen uses run_immediately (#112846)
We have a few places where we call async_listen with a callback so we can schedule
the coro eagerly. We can drop these in favor of setting run_immediately now.
2024-03-09 23:04:25 -05:00
Jan Bouwhuis caaa03536b
Cleanup mqtt PLATFORMS constant and CI-test platform filters (#112847) 2024-03-09 23:48:54 +01:00
J. Nick Koston 23ebd80285
Schedule coroutines with eager_task from async_track_state_change_event (#112807) 2024-03-09 11:24:54 -10:00
J. Nick Koston 4882fed939
Avoid saving auth right after we load it during startup (#112008) 2024-03-09 11:03:22 -10:00
Arie Catsman 44abe329a2
Enphase Envoy refactor and extend diagnostics (#109080)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-09 11:03:07 -10:00
Jan Bouwhuis 3b0ea52167
Allow Just-in-Time platform setup for mqtt (#112720)
* Allow Just-in-Time platform setup for mqtt

* Only forward the setup of new platforms

* Fix new  platforms being setup at reload + test

* Revert not related changes

* Remove unused partial

* Address comments, only import plaforms if needed

* Apply suggestions from code review

* Add multipl platform discovery test

* Improve test

* Use a lock per platform
2024-03-09 21:55:00 +01:00
J. Nick Koston d0d1af8991
Improve performance of image streams (#112810) 2024-03-09 10:26:48 -10:00
Joost Lekkerkerker 033dd35655
Add icon translations to Yeelight (#112363)
* Add icon translations to Yeelight

* Add icon translations to Yeelight
2024-03-09 20:48:21 +01:00
Robert Svensson 020b656f51
Split out Axis config data (#112825)
Split out config data
2024-03-09 13:00:25 -05:00
Robert Svensson 03e4a20cdf
Rename get_deconz_session to get_deconz_api (#112826)
Move and rename get_deconz_session to get_deconz_api
2024-03-09 18:32:31 +01:00
jan iversen 59083b4e82
Remove deprecated retry_on_empty from modbus (#112822)
Remove deprecated retry_on_empty.
2024-03-09 13:59:09 +01:00
jan iversen 797983236f
Remove deprecated CLOSE_COMM_ON_ERROR from modbus (#112821) 2024-03-09 13:24:06 +01:00
Jan Bouwhuis 6534943837
Revert "Cleanup mqtt discovery code" (#112818)
Revert "Cleanup mqtt discovery code (#112749)"

This reverts commit 87318c9111.
2024-03-09 12:54:10 +01:00
jan iversen fca3ac9903
Update modbus test to include a dummy sensor (#112820) 2024-03-09 12:19:57 +01:00
Jan Bouwhuis 87318c9111
Cleanup mqtt discovery code (#112749)
* Cleanup mqtt discovery code

* Cleanup mqtt discovery code
2024-03-09 11:54:27 +01:00
J. Nick Koston 2b0b3c238a
Make SSDP tasks background HassJob to avoid delaying startup (#112668) 2024-03-08 23:11:00 -10:00
J. Nick Koston b7d9f26cee
Cache the job type for entity service calls (#112793) 2024-03-08 22:49:08 -10:00
Robert Svensson f2879e6f39
Break out UniFi platform registration to its own class (#112514) 2024-03-09 09:18:23 +01:00
J. Nick Koston a50883d975
Run service call tasks eagerly (#112791) 2024-03-08 20:37:21 -10:00
Allen Porter 2789060bbe
Fix local calendar handling of empty recurrence ids (#112745)
* Fix handling of empty recurrence ids

* Revert logging changes
2024-03-08 22:28:04 -05:00
Aaron Bach 3405bda835
Make sure Notion saves new refresh token upon startup (#112676)
* Make sure Notion saves new refresh token upon startup

* Code review

* Typing

* Smoother syntax

* Fix tests

* Fix tests for real
2024-03-08 22:27:56 -05:00
J. Nick Koston 65358c129a
Replace periodic tasks with background tasks (#112726)
* Phase out periodic tasks

* false by default or some tests will block forever, will need to fix each one manually

* kwarg works

* kwarg works

* kwarg works

* fixes

* fix more tests

* fix more tests

* fix lifx

* opensky

* pvpc_hourly_pricing

* adjust more

* adjust more

* smarttub

* adjust more

* adjust more

* adjust more

* adjust more

* adjust

* no eager executor

* zha

* qnap_qsw

* fix more

* fix fix

* docs

* its a wrapper now

* add more coverage

* coverage

* cover all combos

* more fixes

* more fixes

* more fixes

* remaining issues are legit bugs in tests

* make tplink test more predictable

* more fixes

* feedreader

* grind out some more

* make test race safe

* one more
2024-03-08 21:45:10 -05:00
J. Nick Koston 08416974c9
Avoid trying to load translations for integrations that have none (#112683) 2024-03-08 14:21:44 -10:00
J. Nick Koston af6f2a516e
Guard against db corruption when renaming entities (#112718) 2024-03-08 11:34:07 -10:00
Marc Mueller cef20506dc
Replace EventType with Event [missing] (#112753) 2024-03-08 21:56:42 +01:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
puddly 55b2d1a00c
Disable updating ZHA coordinator path from discovery info (#112415)
* Never update the device path from config flows

* Bring coverage up to 100%

* Update tests/components/zha/test_config_flow.py

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-03-08 14:33:33 -05:00
Marc Mueller 959826c4b4
Update byte string formatting (#112752) 2024-03-08 20:32:40 +01:00
Sid 0e86f182cc
Add diagnostics to webmin (#112543) 2024-03-08 20:09:31 +01:00
Marc Mueller b026b5d589
Replace EventType with Event [helpers] (#112743) 2024-03-08 19:41:50 +01:00
Marc Mueller a6b842f818
Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller cb8c14496c
Use more f-strings [ruff] (#112695) 2024-03-08 18:44:42 +01:00
Marc Mueller 19ab3d6daf
Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
jan iversen ea89fa6b1e
Allow duplicate names in different modbus entities (#112701)
Allow duplicate names in different entities.
2024-03-08 15:10:35 +01:00
Marc Mueller 1722e23df8
Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Marc Mueller 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Marc Mueller 7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
Marc Mueller 87165c0d6e
Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
Marc Mueller 2d701d5a7d
Use aiohttp.AppKey for http cors keys (#112658) 2024-03-08 11:51:59 +01:00
Thomas55555 9ba5159ae2
Add reauthentication for husqvarna_automower (#109930)
* Add reauthentication for husqvarna_automower

* Remove unneded lines

* Don't extract token on reauth

* Update homeassistant/components/husqvarna_automower/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/husqvarna_automower/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Use helper

* Test if authentication is done with the right account

* switch to ConfigFlowResult

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-03-08 11:30:39 +01:00
Marc Mueller eb8f8e1ae4
Use aiohttp.AppKey for http ban keys (#112657) 2024-03-08 11:13:24 +01:00
Jim d2effd8693
Bump python-telegram-bot package to 21.0.1 (#110297)
* Bump python-telegram-bot package version to the latest.

* PySocks is no longer required as python-telegram-bot doesn't use urllib3 anymore.

* Fix moved ParseMode import

* Update filters import to new structure.

* Refactor removed Request objects to HTTPXRequest objects.

* Update to support asyncc functions

* Update timeout to new kwarg

connect_timeout is the most obvious option based on current param description, but this may need changing.

* Compatibility typo.

* Make methods async and use Bot client async natively

* Type needs to be Optional

That's what the source types are from the library
Also handle new possibility of None value

* Add socks support version of the library

* Refactor load_data function

Update to be async friendly
Refactor to use httpx instead of requests.

* Refactor Dispatcher references to Application

This is the newer model of the same class.

* Make more stuff async-friendly.

* Update tests to refactor Dispatcher usage out.

* Remove import and reference directly

* Refactor typing method

* Use async_fire now we have async support

* Fix some over complicate inheritance.

* Add the polling test telegram_text event fired back in.

* Add extra context to comment

* Handler should also be async

* Use underscores instead of camelCase

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

* Renamed kwarg.

* Refactor current timeout param to be read timeout

Reading the old version of the library code I believe this matches the existing functionality best

* Combine unload methods into one listener

* Fix test by stopping HA as part of fixture

* Add new fixture to mock stop_polling call

Use this in all polling tests.

* No longer need to check if application is running

It was to stop a test failing.

* Make sure the updater is started in tests

Mock external call methods
Remove stop_polling mock.

* Use cleaner references to patched methods

* Improve test by letting the library create the Update object

* Mock component tear down methods to be async

* Bump mypy cache version

* Update dependency to install from git

Allows use as a custom component in 2024.3
Allows us to track mypy issue resolution.

* Update manifest and requirements for new python-telegram-bot release.

* Remove pytest filterwarnings entry for old version of python-telegram-bot library.

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-08 08:56:26 +01:00
J. Nick Koston caefdc6192
Avoid writing registries to disk during startup (#112662) 2024-03-07 19:14:42 -10:00
J. Nick Koston a6b17dbe68
Schedule polling as periodic tasks (#112640)
* Schedule periodic coordinator updates as background tasks.

Currently, the coordinator's periodic refreshes delay startup because they are not scheduled as background tasks. We will wait if the startup takes long enough for the first planned refresh. Another coordinator's scheduled refresh will be fired on busy systems, further delaying the startup. This chain of events results in the startup taking a long time and hitting the safety timeout because too many coordinators are refreshing.

This case can also happen with scheduled entity refreshes, but it's less common. A future PR will address that case.

* periodic_tasks

* periodic_tasks

* periodic_tasks

* merge

* merge

* merge

* merge

* merge

* fix test that call the sync api from async

* one more place

* cannot chain

* async_run_periodic_hass_job

* sun and pattern time changes from automations also block startup

* Revert "sun and pattern time changes from automations also block startup"

This reverts commit 6de2defa05.

* make sure polling is cancelled when config entry is unloaded

* Revert "Revert "sun and pattern time changes from automations also block startup""

This reverts commit e8f12aad55.

* remove DisabledError from homewizard test as it relies on a race

* fix race

* direct coverage
2024-03-07 23:32:26 -05:00
J. Nick Koston 5da629b3e5
Log waiting tasks in bootstrap that are delaying startup (#112637) 2024-03-07 13:18:18 -10:00
Joost Lekkerkerker c1d45f63f5
Fix Bang and olufsen naming (#111344)
* Fix Bang and olufsen naming

* Fix

* Fix tests

* Fix tests
2024-03-07 20:15:52 +01:00
Marc Mueller f3594c543d
Use KEY_HASS [a-g] (#112609) 2024-03-07 18:09:20 +01:00
Marc Mueller 8ca127df2a
Use KEY_HASS [h-z] (#112610) 2024-03-07 18:03:44 +01:00
Erik Montnemery fa4c0d78e9
Restore the juicenet integration (#112578) 2024-03-07 16:41:54 +01:00
Marc Mueller 531e25cbc6
Change KEY_HASS to be an aiohttp AppKey (#111954) 2024-03-07 13:37:48 +01:00
Joost Lekkerkerker d42dd0114d
Add icon translations to Twinkly (#112328) 2024-03-07 12:33:28 +01:00
J. Nick Koston 1fb9cfe37e
Speed up the frame helper (#112562) 2024-03-06 20:54:09 -10:00
J. Nick Koston e12e129065
Make HassJob job_type lookup lazy (#112563) 2024-03-06 17:03:27 -10:00
J. Nick Koston a7b4cd3512
Pass job type to event listeners when creating entities (#112551) 2024-03-06 16:10:07 -10:00
J. Nick Koston 1772e5257c
Move analytics setup to later stage to avoid delaying frontend startup (#112535)
Move analytics setup to stage 1 to avoid delaying frontend startup

analytics was only needed in the frontend startup phase for onboarding.
Its very unlikely the user will be able to complete the onboarding
steps and get to the analytics screen before analytics is done loading
so we can delay loading it until stage 1. To be absolutely sure that
it is ready, the core_config step in onboarding will wait to proceed
if it is some how still being setup
2024-03-06 20:37:41 -05:00
Joost Lekkerkerker 74dabff4a7
Add icon translations to Waze Travel Time (#112352)
* Add icon translations to Waze Travel Time

* Fix tests
2024-03-06 17:06:41 -05:00
J. Nick Koston 675b1a392b
Fix homekit creating executor jobs to resolve default listen ips (#112522) 2024-03-06 11:46:23 -10:00
J. Nick Koston b8e39bd968
Increase bootstrap preload test timeout (#112520) 2024-03-06 11:06:55 -10:00
Sid d50e4f6645
Add snapshot tests to webmin (#112518)
add snapshot tests to webmin
2024-03-06 20:22:08 +01:00
Erik Montnemery 770e48d512
Simplify color mode logic in Tuya light (#110327)
* Simplify color mode logic in Tuya light

* Remove exclusion from LightEntity.__should_report_light_issue

* Fix test
2024-03-06 18:28:12 +01:00
Joost Lekkerkerker c8f39911cc
Enable some PERF rules (#112498)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-06 17:50:41 +01:00
Joost Lekkerkerker 656ef143da
Add icon translations to Wallbox (#112350)
* Add icon translations to Wallbox

* fix
2024-03-06 16:27:13 +01:00
Joost Lekkerkerker f368457544
Add icon translations to Sonarr (#112233) 2024-03-06 16:05:35 +01:00
Erik Montnemery 807c3ca76b
Add custom integration block list (#112481)
* Add custom integration block list

* Fix typo

* Add version condition

* Add block reason, simplify blocked versions, add tests

* Change logic for OK versions

* Add link to custom integration's issue tracker

* Add missing file

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-06 13:56:47 +01:00
Joost Lekkerkerker 0cdc90468e
Add icon translations to Tailscale (#112302) 2024-03-06 13:38:32 +01:00
Joost Lekkerkerker a23dbe4727
Add icon translations to Whois (#112356) 2024-03-06 13:36:01 +01:00
Joost Lekkerkerker 6be2fa1293
Add icon translations to Zerproc (#112366) 2024-03-06 13:35:08 +01:00
Joost Lekkerkerker 503d39ef0d
Add icon translations to TP-Link Omada (#112318)
* Add icon translations to TP-Link Omada

* Add icon translations to TP-Link Omada
2024-03-06 12:36:20 +01:00
Joost Lekkerkerker dc2d83f131
Add icon translations to ViCare (#112346)
* Add icon translations to ViCare

* Add icon translations to ViCare
2024-03-06 12:35:30 +01:00
Joost Lekkerkerker c00426293d
Add icon translations to Twentemilieu (#112327) 2024-03-06 11:51:23 +01:00
Joost Lekkerkerker c8f340966e
Add icon translations to Elgato (#111423) 2024-03-06 11:49:36 +01:00
Joost Lekkerkerker 2c42517ac4
Add icon translations to Tailwind (#112303) 2024-03-06 11:37:05 +01:00
Thomas55555 0a11cb5382
Avoid errors when there is no internet connection in Husqvarna Automower (#111101)
* Avoid errors when no internet connection

* Add error

* Create task in HA

* change from matter to automower

* tests

* Update homeassistant/components/husqvarna_automower/coordinator.py

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

* address review

* Make websocket optional

* fix aioautomower version

* Fix tests

* Use stored websocket

* reset reconnect time after sucessful connection

* Typo

* Remove comment

* Add test

* Address review

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-06 11:25:56 +01:00
Erik Montnemery 8c2c3e0839
Improve integration_entities template function (#111943) 2024-03-06 11:05:06 +01:00
Aidan Timson 2599252600
Post System Bridge 4.x.x integration improvements (#112189)
* Dont remove api key during migration

* Fix return

* Fix test

* Make lambda more readable

* Move fixtures to init, move migration test to test_init.py

* Refactor config_entry data assignment

* Refactor system_bridge migration tests

* Fix type for debug message

* Fix type for debug message

* Remove duplicated unused code (rebase error)

* Refactor test_migration_minor_2_to_1 to test_migration_minor_future_to_2

* Fix version check in async_migrate_entry

* Update migration logic to handle future minor version

* Add ConfigEntryState assertion in test_init.py

* Change condition to minor_version < 2

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

* Refactor system bridge migration tests

* Remove minor downgrade code

* Update tests/components/system_bridge/test_init.py

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

* Update tests/components/system_bridge/test_init.py

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

* Apply suggestions from code review

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

* Move dataclass to store requested data to data.py

* Use dataclass in config flow

* Move media player and sensor onto data.py dataclass

* Move data and handler inside validate

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-06 10:47:21 +01:00
J. Nick Koston 72ac2f127f
Wait to start emulated_hue until the started event (#112477) 2024-03-05 22:25:11 -10:00
Brett Adams f801ec45ce
Bump tesla-fleet-api to 0.4.9 (#112288)
* Bump to 0.4.9

* Use SubscriptionRequired instead of PaymentRequired
2024-03-06 09:09:15 +01:00
J. Nick Koston f3a9756f81
Avoid waiting for integration platforms in the parent integration (#112467) 2024-03-05 21:16:42 -10:00
J. Nick Koston 87739bc072
Add test to ensure bootstrap continues if an integraton raises CancelledError (#112472) 2024-03-05 19:34:16 -10:00
Joost Lekkerkerker fdb85f9e9e
Add icon translations to TechnoVE (#112306)
* Add icon translations to TechnoVE

* Add icon translations to TechnoVE
2024-03-06 06:31:58 +01:00
J. Nick Koston 8fe80a4766
Migrate remaining get_platform in check_config to async_get_platform (#112470)
These were very likely to be cached so they were low on the
list to migrate, but since they are called in the event loop
its best to be sure we do no blocking I/O
2024-03-05 23:47:41 -05:00
J. Nick Koston 982c8f8f4a
Fix incorrect scope on checking files to load in translations (#112457)
discovered in https://github.com/home-assistant/core/pull/112295#discussion_r1513505710

We only checked if the last language had files to load
instead of all of them. The checks for each language
are the same because the only reason we would skip
a language is a missing/broken integration or the integration
is a single file. Both of these loop conditions are always
the same reguardless of the language so the check worked
2024-03-05 23:46:24 -05:00
J. Nick Koston aa216f0298
Add system_health to the hassio pre-imports to avoid a late executor job (#112466)
* Add system_health to the hassio pre-imports to avoid a late executor job

`2024-03-05 17:01:33.034 DEBUG (MainThread) [homeassistant.loader] Importing platforms for hassio executor=[system_health] loop=[] took 0.12s`

This one does not take that much time but it happens at a time where
the import executor is the most busy during startup

* key

* move patch as its too early now
2024-03-05 21:31:38 -05:00
J. Nick Koston 3f9dbd3e25
Fix config modules being imported in the event loop (#112462)
* Fix config modules being imported in the event loop

There was a late import in this integration because of the circular import.

The code has been rearranged to avoid the circular imports

* fixes

* fixes

* fix patching

* make eager

* remove unrelated change from this branch
2024-03-05 21:18:57 -05:00
J. Nick Koston fbabbc8f92
Limit legacy state translations to custom components (#112295)
* Limit legacy state translations to custom components

We were trying to load **thousands** of `*.light.json`, `*.switch.json` files at run time that did not exist.

There have been replaced with entity translations: https://github.com/home-assistant/developers.home-assistant/pull/1557 https://github.com/home-assistant/core/pull/82701

https://github.com/home-assistant/core/pull/112023 will completely remove them, but
for now we will only load them for custom components to reduce the number
of files having to be examined

* reduce

* reduce

* reduce

* reduce

* comment

* coverage

* try to remove empty dict in loaded_translations fallback when missing
2024-03-05 17:27:45 -05:00
J. Nick Koston 235771aaa2
Bump SQLAlchemy to 2.0.28 (#112314) 2024-03-05 12:14:30 -10:00
Erik Montnemery 3d3e9900c3
Add TypeVar default for FlowResult (#112345)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-03-05 22:52:11 +01:00
jan iversen 4a1681bb4b
Allow duplicate modbus addresses on different devices (#112434) 2024-03-05 22:11:04 +01:00
Robert Svensson 7c9891fff9
Break out UniFi config handling to own class (#111325) 2024-03-05 21:36:26 +01:00
Jan-Philipp Benecke dda0f0d9aa
Remove the deprecated YAML support for Aftership (#112390) 2024-03-05 21:28:50 +01:00
Erik Montnemery a515603aaf
Add button to homeworks (#112269) 2024-03-05 19:10:13 +01:00
J. Nick Koston 946572e382
Simplify loader preload logic for config_flows (#112290)
We previously checked Integration.config_flow to see if we should
pre-import the config flow, but this is now always set for some
integration like `homeassistant_green`, `hassio`, etc. Instead
we can add it to the rest of the platforms since we already know
which files exist. This simplifies the logic and ensures the pre-import
still happens if the file is there even if its not listed in the
manifest

`2024-03-04 22:54:31.906 DEBUG (MainThread) [homeassistant.loader] Importing platforms for homeassistant_green executor=[config_flow] loop=[] took 2.74s`
2024-03-05 10:02:23 -05:00