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
|
@ -940,6 +940,7 @@ async def test_websocket_bind_unbind_devices(
|
|||
@pytest.mark.parametrize("command_type", ["bind", "unbind"])
|
||||
async def test_websocket_bind_unbind_group(
|
||||
command_type: str,
|
||||
hass: HomeAssistant,
|
||||
app_controller: ControllerApplication,
|
||||
zha_client,
|
||||
) -> None:
|
||||
|
@ -947,8 +948,9 @@ async def test_websocket_bind_unbind_group(
|
|||
|
||||
test_group_id = 0x0001
|
||||
gateway_mock = MagicMock()
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.zha.websocket_api.get_gateway",
|
||||
"homeassistant.components.zha.websocket_api.get_zha_gateway",
|
||||
return_value=gateway_mock,
|
||||
):
|
||||
device_mock = MagicMock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue