Commit Graph

39 Commits (e15eda3aa26bad430a437b4efb42d7efa4472784)

Author SHA1 Message Date
Mike Degatano ad55c9cc19
Remaining addon management to aiohasupervisor (#128484)
* Move set addon options to aiohasupervisor

* addon stats to aiohasupervisor and test fixes

* addon changelogs to aiohasupervisor

* Raise correct error for library in tests

* Cache client in instance property

* Use singleton method rather then HassIO instance method

* Mock supervisor client in more tests
2024-10-21 16:41:00 +02:00
epenet c5046f7809
Add check for valid abort reason translation in option flows (#128444) 2024-10-16 13:41:15 +02:00
epenet 2542ddd30a
Improve check for user-visible flows when checking translations in tests (#128434)
* Improve check for user-visible flows when checking translations in tests

* Fix nest (from DHCP)

* Ignore homeassistant_hardware

* Improve logic
2024-10-15 14:09:53 +02:00
Mike Degatano a9aa5ad229
Use aiohasupervisor for store APIs (#126780)
* Use aiohasupervosor for store addon info

* Use aiohasupervisor install addon

* Use aiohasupervisor for store info API

* Fix onboarding test

* Changes from feedback

* Move get_supervisor_client out of constructor

* Mock supervisor_client in tests

* Make property private
2024-10-10 10:27:20 +02:00
Mike Degatano 7517948900
Replace more addon management with aiohasupervisor (#126236)
* Replace start_addon with library call

* restart_addon to library and error issues in tests

* stop_addon to library

* uninstall_addon to library

* Add output typing

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-24 15:47:29 +02:00
Mike Degatano 97d0d91d2c
Use aiohasupervisor for addon info calls (#125926)
* Use aiohasupervisor for addon info calls

* Fix issue/repair tests in supervisor

* Fixes from feedback
2024-09-17 23:22:35 +02:00
epenet bd2b72235e
Use root import in tests (#125862)
* Use root import in components

* One more
2024-09-13 06:42:32 +02:00
Jan Bouwhuis 26e87509be
Cleanup hassio fixtures in home assistant hardware integration tests (#124500) 2024-08-23 19:40:35 +02:00
epenet a24fdd1c2b
Add missing hass type hint in component tests (h) (#124209)
* Add missing hass type hint in component tests (h)

* Fix import
2024-08-19 12:40:56 +02:00
puddly 1f488b00f8
Abstract SkyConnect firmware config flow to the hardware platform (#122140)
* Move the SkyConnect config flow to hardware;

* Clean up

* Get SkyConnect unit tests passing

* Split apart `test_util.py`

* Migrate `test_config_flow`

* Remove unnecessary constants

* Re-apply `contextmanager` typing from #122250

* Move the SkyConnect translation strings into hardware
2024-07-29 12:39:25 -04:00
Marc Mueller 8bca9a3449
Fix return type annotations in tests (#122184) 2024-07-19 16:44:03 +02:00
Marc Mueller 921430d497
Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
epenet 3d1165519d
Fix broad-exception-raised in component tests (#119467) 2024-06-12 17:53:42 +02:00
epenet fb1b0058ee
Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-12 15:50:27 +02:00
epenet fbaba3753b
Fix root-import pylint warning in components (#119294)
* Fix root-import pylint warning in components

* Adjust

* Adjust
2024-06-10 15:14:49 +02:00
Marc Mueller 33ed4fd862
Import Generator from typing_extensions (3) (#118990) 2024-06-06 17:28:59 +02:00
epenet 492b158818
Add return type hints in tests (a-i) (#118939) 2024-06-06 12:17:08 +02:00
epenet b09f3eb313
Fix incorrect current_request_with_host type hint (#118809) 2024-06-04 16:26:39 +02:00
epenet 24f83c5890
Use is in FlowResultType enum comparison in tests (#114917)
* Use is in FlowResultType enum comparison in tests

* Adjust auth

* Adjust systemmonitor

* Once more

* Add comment
2024-04-05 10:40:14 +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
Sid 27e844e3bf
Add ruff B005, B015, B032 and fix occurrences (#113543)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-15 17:48:37 -10:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Erik Montnemery 3895defff9
Improve calls to async_show_progress in homeassistant_hardware (#107789) 2024-01-14 10:41:44 +01:00
puddly bd8f01bd35
Bump ZHA dependencies (#104335) 2023-11-29 11:30:15 +01:00
c0ffeeca7 b3b5ca9b95
Terminology: Rename Multi-PAN to Multiprotocol to be consistent (#99262) 2023-10-01 16:20:09 +02:00
puddly a6f325d05a
Cache device trigger info during ZHA startup (#99764)
* Do not connect to the radio hardware within `_connect_zigpy_app`

* Make `connect_zigpy_app` public

* Create radio manager instances from config entries

* Cache device triggers on startup

* reorg zha init

* don't reuse gateway

* don't nuke yaml configuration

* review comments

* Fix existing unit tests

* Ensure `app.shutdown` is called, not just `app.disconnect`

* Revert creating group entities and device registry entries early

* Add unit tests

---------

Co-authored-by: David F. Mulcahey <david.mulcahey@icloud.com>
2023-09-11 14:36:01 +02:00
puddly c8ef3f9393
Automatic migration from multi-PAN back to Zigbee firmware (#93831)
* Initial implementation of migration back to Zigbee firmware

* Fix typo in `BACKUP_RETRIES` constant name

* Name potentially long-running tasks

* Add an explicit timeout to `_async_wait_until_addon_state`

* Guard against the addon not being installed when uninstalling

* Do not launch the progress flow unless the addon is being installed

* Use a separate translation key for confirmation before disabling multi-PAN

* Disable the bellows UART thread within the ZHA config flow radio manager

* Enhance config flow progress keys for flasher addon installation

* Allow `zha.async_unload_entry` to succeed when ZHA is not loaded

* Do not endlessly spawn task when uninstalling addon synchronously

* Include `uninstall_addon.data.*` in SkyConnect and Yellow translations

* Make `homeassistant_hardware` unit tests pass

* Fix SkyConnect unit test USB mock

* Fix unit tests in related integrations

* Use a separate constant for connection retrying

* Unit test ZHA migration from multi-PAN

* Test ZHA multi-PAN migration helper changes

* Fix flaky SkyConnect unit test being affected by system USB devices

* Unit test the synchronous addon uninstall helper

* Test failure when flasher addon is already running

* Test failure where flasher addon fails to install

* Test ZHA migration failures

* Rename `get_addon_manager` to `get_multiprotocol_addon_manager`

* Remove stray "addon uninstall" comment

* Use better variable names for the two addon managers

* Remove extraneous `self.install_task = None`

* Use the addon manager's `addon_name` instead of constants

* Migrate synchronous addon operations into a new class

* Remove wrapper functions with `finally` clause

* Use a more descriptive error message when the flasher addon is stalled

* Fix existing unit tests

* Remove `wait_until_done`

* Fully replace all addon name constants with those from managers

* Fix OTBR breakage

* Simplify `is_hassio` mocking

* Add missing tests for `check_multi_pan_addon`

* Add missing tests for `multi_pan_addon_using_device`

* Use `waiting` instead of `sync` in class name and methods
2023-08-28 17:26:34 -04:00
Erik Montnemery c7f6d84058
Warn when changing multipan channel if there are not 2 known users (#95898)
* Warn when changing multipan channel if there are not 2 known users

* Add test

* Improve messages

* Tweak translation string

* Adjust message

* Remove unused translation placeholders
2023-07-05 16:51:28 +02:00
Erik Montnemery 15e5cf01bb
Add `silabs_multiprotocol` platform (#92904)
* Add silabs_multiprotocol platform

* Add new files

* Add ZHA tests

* Prevent ZHA from creating database during tests

* Add delay parameter to async_change_channel

* Add the updated dataset to the dataset store

* Allow MultipanProtocol.async_change_channel to return a task

* Notify user about the duration of migration

* Update tests
2023-06-01 12:32:14 +02:00
Erik Montnemery 3c3860c923
Make OTBR use same channel as ZHA (#88546) 2023-03-28 12:34:25 +02:00
Erik Montnemery 50ea0c5cf2
Tweak multiprotocol tests (#90163) 2023-03-23 10:12:42 +01:00
Erik Montnemery 0ecd043cb2
Add test helper mock_config_flow (#90103) 2023-03-22 08:59:35 -04:00
puddly 4b88a71d60
Re-enable multi-PAN (#86533)
Revert "Disable multi-pan (#83603)"

This reverts commit 9c7b80090a.
2023-01-24 19:05:17 +01:00
Martin Hjelmare 94b80db968
Handle not available add-on in hassio add-on manager (#84943)
* Handle not available add-on in hassio add-on manager

* Fix zwave_js tests

* Fix sky connect tests

* Fix matter tests

* Fix yellow tests

* Update hardware tests
2023-01-02 20:28:21 -05:00
Paulus Schoutsen ea8511bcfc
Disable multi-pan (#83603)
* Disable multi-pan

* One more test skip
2022-12-08 22:43:52 -05:00
Erik Montnemery c4afc33fc5
Add abc.ABC to classes with abstract methods (#83546) 2022-12-08 17:50:36 +01:00
Erik Montnemery b7652c78ee
Add options flow to enable multiprotocol support on sky connect (#82525) 2022-11-29 16:34:55 -05:00
Erik Montnemery be7e76f302
Migrate ZHA when enabling multi-PAN support on HA Yellow (#82213)
* Migrate ZHA when enabling multi-PAN support on HA Yellow

* Refactor BaseZhaFlow.async_step_maybe_confirm_ezsp_restore

* Change data passed to ZHA to initiate migration

* Catch errors during ZHA migration

* Fix ZhaMigrationHelper.async_prepare_yellow_migration return value

* Improve test coverage

* Improve test coverage

* Fix spelling

* Rename some none HA yellow specifics

* Rename again

* Increase number of migration retries + refactor

* Suppress OperationNotAllowed when reloading

* Adjust tests
2022-11-22 11:17:23 +01:00
Erik Montnemery aaec464627
Add support for managing the silabs multiprotocol add-on (#82170)
* Add support for managing the silabs multiprotocol add-on

* Fix passing context when starting option flow

* Allow unloading a ha yellow config entry

* Fix tests

* Log data passed to ZHA option flow

* Improve ZHA migration logic

* Move tests

* Improve test coverage

* Remove dead code

* Drop automatic ZHA migration
2022-11-16 17:38:07 +01:00