Improve deCONZ websocket fixture (#121332)

This commit is contained in:
Robert Svensson 2024-07-05 22:35:06 +02:00 committed by GitHub
parent 9d204613e8
commit 1b8944dab6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 185 additions and 114 deletions

View file

@ -16,7 +16,7 @@ from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, STATE_UNAVA
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .conftest import ConfigEntryFactoryType
from .conftest import ConfigEntryFactoryType, WebsocketDataType
from tests.test_util.aiohttp import AiohttpClientMocker
@ -56,7 +56,7 @@ async def test_power_plugs(
hass: HomeAssistant,
config_entry_setup: ConfigEntry,
mock_put_request: Callable[[str, str], AiohttpClientMocker],
mock_deconz_websocket,
mock_websocket_data: WebsocketDataType,
) -> None:
"""Test that all supported switch entities are created."""
assert len(hass.states.async_all()) == 4
@ -72,7 +72,7 @@ async def test_power_plugs(
"id": "1",
"state": {"on": False},
}
await mock_deconz_websocket(data=event_changed_light)
await mock_websocket_data(event_changed_light)
await hass.async_block_till_done()
assert hass.states.get("switch.on_off_switch").state == STATE_OFF