mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Send a result for the ZHA reconfigure websocket subscription (#184812)
This commit is contained in:
@@ -514,6 +514,7 @@ async def websocket_reconfigure_node(
|
||||
remove_dispatcher_function()
|
||||
|
||||
connection.subscriptions[msg["id"]] = async_cleanup
|
||||
connection.send_result(msg[ID])
|
||||
|
||||
_LOGGER.debug("Re-interview node with ieee_address: %s", ieee)
|
||||
hass.async_create_task(zha_gateway.async_reinterview_device(ieee))
|
||||
|
||||
@@ -1280,7 +1280,7 @@ async def test_websocket_reconfigure(
|
||||
|
||||
messages = []
|
||||
|
||||
while len(messages) != 3:
|
||||
while len(messages) != 4:
|
||||
msg = await zha_client.receive_json()
|
||||
|
||||
if msg[ID] == 6:
|
||||
@@ -1289,8 +1289,12 @@ async def test_websocket_reconfigure(
|
||||
# Ensure the gateway re-interview was triggered with the correct IEEE
|
||||
assert reinterview_mock.mock_calls == [call(zha_device_proxy.device.ieee)]
|
||||
|
||||
# Ensure the subscription is confirmed, so the frontend can unsubscribe
|
||||
assert messages[0]["type"] == "result"
|
||||
assert messages[0]["success"]
|
||||
|
||||
# Ensure the frontend receives progress events
|
||||
assert {m["event"]["type"] for m in messages} == {
|
||||
assert {m["event"]["type"] for m in messages[1:]} == {
|
||||
"zha_channel_configure_reporting",
|
||||
"zha_channel_bind",
|
||||
"zha_channel_cfg_done",
|
||||
|
||||
Reference in New Issue
Block a user