2022-01-20 22:47:42 +00:00
|
|
|
"""Test deCONZ diagnostics."""
|
2024-03-08 13:50:25 +00:00
|
|
|
|
2022-08-05 23:34:27 +00:00
|
|
|
from pydeconz.websocket import State
|
2023-08-23 19:37:03 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2022-01-20 22:47:42 +00:00
|
|
|
|
2023-02-11 07:26:13 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-01-20 22:47:42 +00:00
|
|
|
|
2023-08-23 19:37:03 +00:00
|
|
|
from .test_gateway import setup_deconz_integration
|
2022-01-20 22:47:42 +00:00
|
|
|
|
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-11 07:26:13 +00:00
|
|
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-01-20 22:47:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def test_entry_diagnostics(
|
2023-02-11 07:26:13 +00:00
|
|
|
hass: HomeAssistant,
|
|
|
|
hass_client: ClientSessionGenerator,
|
|
|
|
aioclient_mock: AiohttpClientMocker,
|
|
|
|
mock_deconz_websocket,
|
2023-08-23 19:37:03 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-11 07:26:13 +00:00
|
|
|
) -> None:
|
2022-01-20 22:47:42 +00:00
|
|
|
"""Test config entry diagnostics."""
|
|
|
|
config_entry = await setup_deconz_integration(hass, aioclient_mock)
|
|
|
|
|
2022-08-05 23:34:27 +00:00
|
|
|
await mock_deconz_websocket(state=State.RUNNING)
|
2022-01-20 22:47:42 +00:00
|
|
|
await hass.async_block_till_done()
|
|
|
|
|
2023-08-23 19:37:03 +00:00
|
|
|
assert (
|
|
|
|
await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
|
|
|
== snapshot
|
|
|
|
)
|