diff --git a/homeassistant/components/zha/websocket_api.py b/homeassistant/components/zha/websocket_api.py index 5acedbe2c251..fa4f84c4d7c1 100644 --- a/homeassistant/components/zha/websocket_api.py +++ b/homeassistant/components/zha/websocket_api.py @@ -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)) diff --git a/tests/components/zha/test_websocket_api.py b/tests/components/zha/test_websocket_api.py index b9fe88821172..71d9948e467c 100644 --- a/tests/components/zha/test_websocket_api.py +++ b/tests/components/zha/test_websocket_api.py @@ -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",