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>
This commit is contained in:
parent
5c206de906
commit
cbb28b6943
44 changed files with 317 additions and 288 deletions
|
@ -21,6 +21,7 @@ from homeassistant.components.fan import (
|
|||
from homeassistant.components.zha.core.device import ZHADevice
|
||||
from homeassistant.components.zha.core.discovery import GROUP_PROBE
|
||||
from homeassistant.components.zha.core.group import GroupMember
|
||||
from homeassistant.components.zha.core.helpers import get_zha_gateway
|
||||
from homeassistant.components.zha.fan import (
|
||||
PRESET_MODE_AUTO,
|
||||
PRESET_MODE_ON,
|
||||
|
@ -45,7 +46,6 @@ from .common import (
|
|||
async_test_rejoin,
|
||||
async_wait_for_updates,
|
||||
find_entity_id,
|
||||
get_zha_gateway,
|
||||
send_attributes_report,
|
||||
)
|
||||
from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_PROFILE, SIG_EP_TYPE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue