Commit Graph

6 Commits (415042f356cb77f136d7abbcc93c8bec9fb85c1d)

Author SHA1 Message Date
puddly cbb28b6943
Migrate internal ZHA data to a dataclasses (#100127)
* Cache device triggers on startup

* reorg zha init

* don't reuse gateway

* don't nuke yaml configuration

* review comments

* Add unit tests

* Do not cache device and entity registries

* [WIP] Wrap ZHA data in a dataclass

* [WIP] Get unit tests passing

* Use a helper function for getting the gateway object to fix annotations

* Remove `bridge_id`

* Fix typing issues with entity references in group websocket info

* Use `Platform` instead of `str` for entity platform matching

* Use `get_zha_gateway` in a few more places

* Fix flaky unit test

* Use `slots` for ZHA data

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: David F. Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-11 21:39:33 +02:00
puddly 22c5071270
Initialize ZHA device database before connecting to the radio (#98082)
* Create ZHA entities before attempting to connect to the coordinator

* Delete the ZHA gateway object when unloading the config entry

* Only load ZHA groups if the coordinator device info is known offline

* Do not create a coordinator ZHA device until it is ready

* [WIP] begin fixing unit tests

* [WIP] Fix existing unit tests (one failure left)

* Fix remaining unit test
2023-08-31 12:09:46 -04:00
jasonkuster a25f3c9b27
Fix ZHA binding api to actually return responses (#94388) 2023-06-12 13:07:42 -04:00
puddly cc47736d20
Include port info in the ZHA websocket settings response (#93934) 2023-06-01 19:53:41 +02:00
puddly f9ac1f3839
Add a channel changing API to ZHA (#92076)
* Expose channel changing over the websocket API

* Expose channel changing as a service

* Type annotate some existing unit test fixtures

* Add unit tests

* Rename `api.change_channel` to `api.async_change_channel`

* Expand on channel migration in the service description

* Remove channel changing service, we only really need the websocket API

* Update homeassistant/components/zha/websocket_api.py

* Black

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-27 11:04:22 -04:00
puddly c581116c82
ZHA network settings API (#88564)
* Rename `zha.api` to `zha.websocket_api`

* Implement a ZHA network settings API

* Use the enum name as the radio type

* Don't filter out ignored config entries

* [WIP] Start unit tests

* Add unit tests

* Rename ZHA websocket API module in `.coveragerc`

* Rename `api` to `websocket_api`

* Increase test coverage to 100%
2023-03-22 11:15:46 -04:00