Provide default values for common keys in deCONZ websocket fixture (#121359)

This commit is contained in:
Robert Svensson 2024-07-06 10:52:50 +02:00 committed by GitHub
parent 1ec95f900d
commit cce77affc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 8 additions and 143 deletions

View file

@ -249,6 +249,12 @@ def fixture_websocket_data(_mock_websocket: _WebsocketMock) -> WebsocketDataType
async def change_websocket_data(data: dict[str, Any]) -> None:
"""Provide new data on the websocket."""
if "t" not in data:
data["t"] = "event"
if "e" not in data:
data["e"] = "changed"
if "id" not in data:
data["id"] = "0"
await _mock_websocket(data=data)
return change_websocket_data