mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 05:20:17 +00:00
Send initial message for certain zwave_js ws subscriptions (#71723)
* Send initial message for certain zwave_js ws subscriptions * Be consistent * fix tests and bugs
This commit is contained in:
@@ -3479,7 +3479,14 @@ async def test_subscribe_firmware_update_status_initial_value(
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["success"]
|
||||
assert msg["result"] == {"sent_fragments": 1, "total_fragments": 10}
|
||||
assert msg["result"] is None
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["event"] == {
|
||||
"event": "firmware update progress",
|
||||
"sent_fragments": 1,
|
||||
"total_fragments": 10,
|
||||
}
|
||||
|
||||
|
||||
async def test_subscribe_firmware_update_status_failures(
|
||||
@@ -3688,7 +3695,12 @@ async def test_subscribe_controller_statistics(
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["success"]
|
||||
assert msg["result"] == {
|
||||
assert msg["result"] is None
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["event"] == {
|
||||
"event": "statistics updated",
|
||||
"source": "controller",
|
||||
"messages_tx": 0,
|
||||
"messages_rx": 0,
|
||||
"messages_dropped_tx": 0,
|
||||
@@ -3783,7 +3795,13 @@ async def test_subscribe_node_statistics(
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["success"]
|
||||
assert msg["result"] == {
|
||||
assert msg["result"] is None
|
||||
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["event"] == {
|
||||
"source": "node",
|
||||
"event": "statistics updated",
|
||||
"nodeId": multisensor_6.node_id,
|
||||
"commands_tx": 0,
|
||||
"commands_rx": 0,
|
||||
"commands_dropped_tx": 0,
|
||||
|
||||
Reference in New Issue
Block a user