Commit Graph

81 Commits

Author SHA1 Message Date
puddly
b3205ea1cd Do not rely on pyserial for port scanning with the CM5 + ZHA (#137585)
Do not rely on pyserial for port scanning with the CM5
2025-02-07 16:33:40 +01:00
epenet
64500e837f Use new ServiceInfo location in component tests (part 1) (#136057) 2025-01-20 13:09:34 +01:00
Marc Mueller
6690b121c0 Fix unicode chars in zha tests (#135954) 2025-01-18 13:47:30 -10:00
Marc Mueller
8a3ef101e6 Replace additional deprecated USBServiceInfo imports (#135953) 2025-01-18 17:43:07 -06:00
epenet
8c13daf6d9 Move SsdpServiceInfo to service_info helpers (#135661)
* Move SsdpServiceInfo to service_info helpers

* docstring

* Move string constants

* Adjust components
2025-01-15 15:00:27 +02:00
puddly
50fdbe9b3b Generic ZHA Zeroconf discovery (#126294) 2024-11-21 20:50:21 +01:00
puddly
245fc246d8 Ensure ZHA setup works with container installs (#130470) 2024-11-14 10:13:29 +01:00
Marc Mueller
44449d8e72 Fix zha test RuntimeWarnings (#128975) 2024-10-22 18:05:40 +02:00
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
e6fc34325d Improve type hints in zha tests (#123926) 2024-08-14 15:39:52 +02:00
puddly
b754f03c11 ZHA as an external library (#120190)
Co-authored-by: David Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2024-07-08 20:18:30 +02:00
epenet
9204ccfa17 Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker
f3ba713289 Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost Lekkerkerker
2ef0521d3d Use is in enum comparison in config flow tests U-Z (#114677)
* Use right enum expression U-Z

* Fix
2024-04-02 23:09:56 +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
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +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
32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
J. Nick Koston
4624c859e1 Use discovery flow helper for hardware integrations (#111437)
* Use discovery flow helper for hardware integrations

The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability.

* Use discovery flow helper for hardware integrations

The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability. Since hardware was not listed in as a
discovery integration, the notification for new discoveries was missing.
2024-02-26 12:04:33 -05:00
J. Nick Koston
7dcf2e94b4 Migrate zha to use async_update_entry to alter config entries (#110402) 2024-02-12 21:24:56 +01:00
J. Nick Koston
f6d4617c7a Avoid directly changing config entry state in tests (part 2) (#110115)
followup to #110048 for more places
2024-02-10 07:20:15 +01:00
puddly
bd8f01bd35 Bump ZHA dependencies (#104335) 2023-11-29 11:30:15 +01:00
J. Nick Koston
0eca433004 Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +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
Marc Mueller
6312f34538 Fix zha test RuntimeWarning (#99519) 2023-09-03 01:07:17 +02:00
puddly
38270ee823 Create a ZHA repair when directly accessing a radio with multi-PAN firmware (#98275)
* Add the SiLabs flasher as a dependency

* Create a repair if the wrong firmware is detected on an EZSP device

* Update homeassistant/components/zha/strings.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

* Provide the ZHA config entry as a reusable fixture

* Create a separate repair when using non-Nabu Casa hardware

* Add unit tests

* Drop extraneous `config_entry.add_to_hass` added in 021def44

* Fully unit test all edge cases

* Move `socket://`-ignoring logic into repair function

* Open a repair from ZHA flows when the wrong firmware is running

* Fix existing unit tests

* Link to the flashing section in the documentation

* Reduce repair severity to `ERROR`

* Make issue persistent

* Add unit tests for new radio probing states

* Add unit tests for new config flow steps

* Handle probing failure raising an exception

* Implement review suggestions

* Address review comments

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-09-01 09:05:45 -04:00
Marc Mueller
d1ad1c47e6 Fix zha test RuntimeWarnings (#97733) 2023-08-04 01:07:11 +02:00
puddly
392e2af2b7 Bump ZHA dependencies (#95478)
* Bump ZHA dependencies

* Account for new EZSP metadata keys
2023-06-28 18:35:05 -04:00
Erik Montnemery
e5b2801f5b Fix ZHA tests (#94588) 2023-06-14 14:21:34 +02:00
puddly
2bbebeb925 Add a warning step to ZHA's config flow to advise against some radios (#92078) 2023-04-26 21:40:46 +02:00
puddly
9575cd9161 Name the Yellow-internal radio and multi-PAN addon as ZHA serial ports (#88208)
* Expose the Yellow-internal radio and multi-PAN addon as named serial ports

* Remove the serial number if it isn't available

* Use consistent names for the addon and Zigbee radio

* Add `homeassistant_hardware` and `_yellow` as `after_dependencies`

* Handle `hassio` not existing when listing serial ports

* Add unit tests
2023-02-23 20:52:53 -05:00
epenet
7427d4f323 Add type hints to integration tests (zha) (#88309) 2023-02-17 18:54:26 +01:00
Franck Nijhof
ed79265843 Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
278050a73f Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
epenet
4142f0d15d Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
puddly
8337d4613e ZHA config flow cleanup (#86742)
fixes undefined
2023-01-30 22:21:34 +01: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
bb64b39d0e Minor refactor of zha config flow (#82200)
* Minor refactor of zha config flow

* Move ZhaRadioManager to a separate module
2022-11-16 17:13:23 +01:00
puddly
74357bef15 Use a unique ID for the Yellow ZHA hardware discovery (#81523)
* Set unique ID for hardware discovery

* Use the provided `name` for discovered hardware
2022-11-07 11:28:28 -05:00
puddly
2dab9073fe ZHA radio migration: reset the old adapter (#79663) 2022-10-06 14:02:24 -04:00
puddly
f19af72895 Bump ZHA dependencies (#78201) 2022-09-10 13:56:01 -04:00
puddly
f8fc90bc07 Add ZHA config flow single instance checks for zeroconf and hardware (#77612) 2022-08-31 12:41:41 -04:00
puddly
4b24370549 ZHA Yellow config flow fixes (#77603) 2022-08-31 11:21:37 -04:00
puddly
f78b39bdbf ZHA backup/restore config flow (#77044) 2022-08-30 12:40:16 -04:00
Erik Montnemery
6d49362573 Revert rename of confirm step in zha config flow (#77010)
* Revert rename of confirm step in zha config flow

* Update tests
2022-08-19 09:33:57 +02:00
Erik Montnemery
bb74730e96 Add support for USB dongles to the hardware integration (#76795)
* Add support for USB dongles to the hardware integration

* Update hardware integrations

* Adjust tests

* Add USB discovery for SkyConnect 1.0

* Improve test coverage

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix frozen dataclass shizzle

* Adjust test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-08-18 21:52:12 +02:00
Erik Montnemery
21ebd1f612 Simplify ZHA config entry title (#76991) 2022-08-18 10:58:44 -04:00
Erik Montnemery
88a5b90489 Minor improvement of zha test (#76993) 2022-08-18 16:52:41 +02:00
Franck Nijhof
a6244eea28 Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
J. Nick Koston
4bc5d7bfed Speed up zha tests (#73627) 2022-06-17 11:41:10 -05:00