mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Show warning message for Z-Wave devices in interview stage (#144483)
* Show warning message for devices in interview stage * remove debug code
This commit is contained in:
parent
d13f9be9d8
commit
e0fb612e82
@ -674,10 +674,18 @@ async def websocket_node_alerts(
|
||||
connection.send_error(msg[ID], ERR_NOT_LOADED, str(err))
|
||||
return
|
||||
|
||||
comments = node.device_config.metadata.comments
|
||||
if node.in_interview:
|
||||
comments.append(
|
||||
{
|
||||
"level": "warning",
|
||||
"text": "This device is currently being interviewed and may not be fully operational.",
|
||||
}
|
||||
)
|
||||
connection.send_result(
|
||||
msg[ID],
|
||||
{
|
||||
"comments": node.device_config.metadata.comments,
|
||||
"comments": comments,
|
||||
"is_embedded": node.device_config.is_embedded,
|
||||
},
|
||||
)
|
||||
|
@ -505,6 +505,22 @@ async def test_node_alerts(
|
||||
assert result["comments"] == [{"level": "info", "text": "test"}]
|
||||
assert result["is_embedded"]
|
||||
|
||||
# Test with node in interview
|
||||
with patch("zwave_js_server.model.node.Node.in_interview", return_value=True):
|
||||
await ws_client.send_json_auto_id(
|
||||
{
|
||||
TYPE: "zwave_js/node_alerts",
|
||||
DEVICE_ID: device.id,
|
||||
}
|
||||
)
|
||||
msg = await ws_client.receive_json()
|
||||
assert msg["success"]
|
||||
assert len(msg["result"]["comments"]) == 2
|
||||
assert msg["result"]["comments"][1] == {
|
||||
"level": "warning",
|
||||
"text": "This device is currently being interviewed and may not be fully operational.",
|
||||
}
|
||||
|
||||
# Test with provisioned device
|
||||
valid_qr_info = {
|
||||
VERSION: 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user