228 Commits

Author SHA1 Message Date
J. Nick Koston
491bde181c
Speed up hassio send_command url check (#125122)
* Speed up hassio send_command url check

The send_command call checked the resulting path to make
sure that the input path was not modified when converting
to a URL. Since the host is is pre-set, we only need to check
the processed raw_path matches command instead of converting
back to a string, and than comparing it against another
constructed string.

* Speed up hassio send_command url check

The send_command call checked the resulting path to make
sure that the input path was not modified when converting
to a URL. Since the host is is pre-set, we only need to check
the processed raw_path matches command instead of converting
back to a string, and than comparing it against another
constructed string.

* adjust
2024-09-03 15:29:02 +02:00
Jan Bouwhuis
26e87509be
Cleanup hassio fixtures in home assistant hardware integration tests (#124500) 2024-08-23 19:40:35 +02:00
Jan Bouwhuis
44b6bca89a
Refactor and cleanup zwave_js fixtures to share them (#124485)
Refactor and cleanup zwave_js fixtures to use
2024-08-23 15:42:57 +02:00
Jan Bouwhuis
51dba1eec3
Cleanup redundant fixtures and move all other hassio addon fixtures to be shared (#124437) 2024-08-22 20:58:05 +02:00
Jan Bouwhuis
61114d8328
Install and start Mosquitto MQTT broker add on from MQTT config flow (#124106)
* Opt in to install Mosquitto broker add-on in MQTT config flow

* rephrase

* Tests with supervisor and running add-on

* Complete tests for success flows

* Also set up entry in success flow

* Use realistic names for addon and broker

* Finetuning and fail test cases

* Spelling

* Improve translation strings

* Update addon docstr

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

* Raise AddonError if add-on does not start

* Only show the option to use the add-on

* Simplify flow, rework and cleanup

* Revert unrelated cleanup, process suggestion

* Move ADDON_SLUG const to addon module

* Move fixture to component level

* Move back supervisor fixture

* Move addon_setup_time_fixture and superfixe to config flow model tests

* Refactor hassio fixture

* Rename helpers as they are no fixtures, remove fixture from their names

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-22 09:07:45 +02:00
epenet
b054c037fe
Improve type hints in hassio tests (#121221) 2024-07-05 09:05:21 +02:00
Marc Mueller
921430d497
Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
epenet
c896458fcf
Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
Mike Degatano
78f53341b7
Always have addon url in detached_addon_missing (#119011) 2024-06-07 10:52:15 +02:00
Marc Mueller
33ed4fd862
Import Generator from typing_extensions (3) (#118990) 2024-06-06 17:28:59 +02:00
epenet
fb51163075
Move socket_enabled fixture to decorator (#118847) 2024-06-06 17:27:38 +02:00
epenet
3d31af3eb4
Move entity_registry_enabled_by_default to decorator [a-p] (#118794) 2024-06-04 16:18:42 +02:00
epenet
3ac0fa53c8
Cleanup unused FixtureRequest in tests (#118780) 2024-06-04 11:49:21 +02:00
epenet
666fc2333a
Add type hints for AiohttpClientMocker in test fixtures (#118691) 2024-06-03 10:13:22 +02:00
epenet
092cdcfe91
Improve type hints in tests (a-h) (#118379) 2024-05-30 08:46:18 +02:00
epenet
461ac1e0bc
Add ClientSessionGenerator type hints in tests (#118377) 2024-05-29 14:49:14 +02:00
epenet
d10362e226
Add AiohttpClientMocker type hints in tests (#118373) 2024-05-29 14:38:46 +02:00
Stefan Agner
cae22e5109
Adjust add-on installation error message (#118309) 2024-05-29 09:41:09 +02:00
epenet
a59621bf9e
Add more type hints to pylint plugin (#118319) 2024-05-28 18:37:38 +02:00
Mike Degatano
dbcef2e3c3
Add more supervisor info to system info panel (#115715)
* Add virtualization field fo system info

* Add ntp sync and host connectivity

* Prevent nonetype errors

* Add supervisor_connectivity and fix tests

* Add mock of network info to other fixtures

* Update more fixtures with network/info mock
2024-05-28 16:14:42 +02:00
Mike Degatano
05c24e92d1
Add repair for detached addon issues (#118064)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-05-26 13:37:50 +02:00
epenet
addc4a84ff
Rename hassio coordinator module (#117611) 2024-05-17 12:10:21 +02:00
Erik Montnemery
b013d6ade9
Fix flaky hassio test (#116658) 2024-05-02 16:24:14 -05:00
J. Nick Koston
76639252c9
Make discovery flow tasks background tasks (#116327) 2024-04-28 08:13:37 -05:00
Mike Degatano
f1ebe9d20a
Add repairs to hassio manifest (#115486)
* Add repairs to hassio manifest

* Remove unnecessary fixture
2024-04-17 15:51:29 +02:00
Mike Degatano
5308e02c99
Add support for adopt data disk repair (#114891) 2024-04-11 11:23:10 +02:00
epenet
0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +02:00
Joost Lekkerkerker
b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Sid
d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
81c34ac952
Fix spelling [docstrings + comments] (#114168) 2024-03-25 11:33:00 +01:00
Sid
00ec7f11f0
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Jan Bouwhuis
6e84dbde35
Fix lingering hassio issues test (#113569) 2024-03-15 15:10:24 -10:00
J. Nick Koston
b7f7bed46c
Import and create pyudev for usb in the executor (#113478) 2024-03-15 09:05:18 -10:00
Mike Degatano
5a25349cf7
Supervisor issues update retries on failure (#113373) 2024-03-14 10:55:04 +01:00
Mike Degatano
6d903300be
Apply suggestion failures fail supervisor repair (#113372) 2024-03-14 10:53:55 +01:00
Stefan Agner
99eaa07f6f
Add message from Bad Request errors to HassioAPIError (#113144)
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2024-03-13 11:29:39 +01: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
Marc Mueller
aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +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
c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01: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 6de2defa0586165c2918ce006cf57aa3acaae730.

* 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 e8f12aad5579a1e5e3930957a46ea6f3dd9beecf.

* 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
f3a9756f81
Avoid waiting for integration platforms in the parent integration (#112467) 2024-03-05 21:16:42 -10: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
d50b4ccd62
Split up hassio coordinator and data into new file to allow preload (#112147)
* Split up hassio coordinator and data into new file to allow preload

Since we cannot mark hassio as having a config_flow, it will
not get preloaded and since cloud will almost always load right
after it and block the import executor, we want to preload
the hassio config_flow and platform modules so the other
dependants can continue on while cloud is being imported
to not delay startup

* tweak

* tweak
2024-03-03 21:16:02 -05:00
Jan-Philipp Benecke
196089e8b7
Remove deprecated hass.components.hassio usage (#111878) 2024-03-02 15:38:31 +01:00
Erik Montnemery
a0e558c457
Add generic classes BaseFlowHandler and BaseFlowManager (#111814)
* Add generic classes BaseFlowHandler and BaseFlowManager

* Migrate zwave_js

* Update tests

* Update tests

* Address review comments
2024-02-29 16:52:39 +01:00
Jan-Philipp Benecke
ebfba7258e
Revert "Drop @bind_hass use from hassio component (#111522)" (#111705)
This reverts commit 4e4345f04e7b4570bbd5dae7d68e20d104df929e.
2024-02-28 10:51:37 +01:00
Jan-Philipp Benecke
4e4345f04e
Drop @bind_hass use from hassio component (#111522)
* Drop `@bind_hass` use from hassio component

* Add comment why we import locally

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-28 00:25:46 +01:00
J. Nick Koston
c4d719a7cf
Use eager_start for background service call tasks (#111620) 2024-02-27 12:06:32 -10:00