Provide default values for common keys in deCONZ websocket fixture (#121359)
This commit is contained in:
parent
1ec95f900d
commit
cce77affc7
15 changed files with 8 additions and 143 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue