Commit Graph

70 Commits (985e42e50c2205f7dbaaac4d369d67bd9c97f758)

Author SHA1 Message Date
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
Erik Montnemery e3b6c7a66f
Add Home Assistant Yellow integration (#73272)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-06-13 23:25:11 -07:00
Fairesoimeme 1d63c2069e
Add ZiGate device on automatic integration USB and ZEROCONF (#68577)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-05-08 18:27:09 -05:00
Joshua Roys 9134e5c844
Get discovered zeroconf IPv6 addresses (#65462) 2022-02-11 16:46:17 -06:00
epenet f292691b7b
Use SsdpServiceInfo for ssdp tests (part 3) (#60334)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 11:46:20 -06:00
epenet 3bf12fcd29
Use UsbServiceInfo and ZeroconfServiceInfo in zha (#60266)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-24 07:50:45 -06:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
puddly 6895081595
Use `async_update_entry` in config unit test instead of modifying `data` (#55855) 2021-09-06 16:57:59 -04:00
J. Nick Koston eba9b61011
Fix exception during rediscovery of ignored zha config entries (#55859)
Fixes #55709
2021-09-06 13:35:24 -07:00
puddly e671ad41ec
Replace zigpy-cc with zigpy-znp (#55828)
* Replace zigpy-cc with zigpy-znp in a ZHA config migration

* Fix failing unit tests
2021-09-06 09:50:54 -04:00
J. Nick Koston d59ea5329e
Abort zha usb discovery if deconz is setup (#55245)
* Abort zha usb discovery if deconz is setup

* Update tests/components/zha/test_config_flow.py

* add deconz domain const

* Update homeassistant/components/zha/config_flow.py

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2021-08-26 10:00:32 -04:00
J. Nick Koston d4fa625a7f
Defer zha auto configure probe until after clicking configure (#55239) 2021-08-26 09:59:41 -04:00