mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Bump zwave-js-server-python to 0.35.3 (#70357)
This commit is contained in:
parent
80653463bf
commit
220cb57add
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from async_timeout import timeout
|
from async_timeout import timeout
|
||||||
from zwave_js_server.client import Client as ZwaveClient
|
from zwave_js_server.client import Client as ZwaveClient
|
||||||
@ -289,12 +290,7 @@ async def async_setup_entry( # noqa: C901
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
# add listener for stateless node notification events
|
# add listener for stateless node notification events
|
||||||
entry.async_on_unload(
|
entry.async_on_unload(node.on("notification", async_on_notification))
|
||||||
node.on(
|
|
||||||
"notification",
|
|
||||||
lambda event: async_on_notification(event["notification"]),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
async def async_on_node_added(node: ZwaveNode) -> None:
|
async def async_on_node_added(node: ZwaveNode) -> None:
|
||||||
"""Handle node added event."""
|
"""Handle node added event."""
|
||||||
@ -402,12 +398,14 @@ async def async_setup_entry( # noqa: C901
|
|||||||
)
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_on_notification(
|
def async_on_notification(event: dict[str, Any]) -> None:
|
||||||
notification: EntryControlNotification
|
|
||||||
| NotificationNotification
|
|
||||||
| PowerLevelNotification,
|
|
||||||
) -> None:
|
|
||||||
"""Relay stateless notification events from Z-Wave nodes to hass."""
|
"""Relay stateless notification events from Z-Wave nodes to hass."""
|
||||||
|
if "notification" not in event:
|
||||||
|
LOGGER.info("Unknown notification: %s", event)
|
||||||
|
return
|
||||||
|
notification: EntryControlNotification | NotificationNotification | PowerLevelNotification = event[
|
||||||
|
"notification"
|
||||||
|
]
|
||||||
device = dev_reg.async_get_device({get_device_id(client, notification.node)})
|
device = dev_reg.async_get_device({get_device_id(client, notification.node)})
|
||||||
# We assert because we know the device exists
|
# We assert because we know the device exists
|
||||||
assert device
|
assert device
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Z-Wave JS",
|
"name": "Z-Wave JS",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/zwave_js",
|
"documentation": "https://www.home-assistant.io/integrations/zwave_js",
|
||||||
"requirements": ["zwave-js-server-python==0.35.2"],
|
"requirements": ["zwave-js-server-python==0.35.3"],
|
||||||
"codeowners": ["@home-assistant/z-wave"],
|
"codeowners": ["@home-assistant/z-wave"],
|
||||||
"dependencies": ["usb", "http", "websocket_api"],
|
"dependencies": ["usb", "http", "websocket_api"],
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
|
@ -2503,7 +2503,7 @@ zigpy==0.44.2
|
|||||||
zm-py==0.5.2
|
zm-py==0.5.2
|
||||||
|
|
||||||
# homeassistant.components.zwave_js
|
# homeassistant.components.zwave_js
|
||||||
zwave-js-server-python==0.35.2
|
zwave-js-server-python==0.35.3
|
||||||
|
|
||||||
# homeassistant.components.zwave_me
|
# homeassistant.components.zwave_me
|
||||||
zwave_me_ws==0.2.4
|
zwave_me_ws==0.2.4
|
||||||
|
@ -1625,7 +1625,7 @@ zigpy-znp==0.7.0
|
|||||||
zigpy==0.44.2
|
zigpy==0.44.2
|
||||||
|
|
||||||
# homeassistant.components.zwave_js
|
# homeassistant.components.zwave_js
|
||||||
zwave-js-server-python==0.35.2
|
zwave-js-server-python==0.35.3
|
||||||
|
|
||||||
# homeassistant.components.zwave_me
|
# homeassistant.components.zwave_me
|
||||||
zwave_me_ws==0.2.4
|
zwave_me_ws==0.2.4
|
||||||
|
@ -307,3 +307,26 @@ async def test_unknown_notification(hass, hank_binary_switch, integration, clien
|
|||||||
notification_obj.node = node
|
notification_obj.node = node
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
node.emit("notification", {"notification": notification_obj})
|
node.emit("notification", {"notification": notification_obj})
|
||||||
|
|
||||||
|
notification_events = async_capture_events(hass, "zwave_js_notification")
|
||||||
|
|
||||||
|
# Test a valid notification with an unsupported command class
|
||||||
|
event = Event(
|
||||||
|
type="notification",
|
||||||
|
data={
|
||||||
|
"source": "node",
|
||||||
|
"event": "notification",
|
||||||
|
"nodeId": node.node_id,
|
||||||
|
"ccId": 0,
|
||||||
|
"args": {
|
||||||
|
"commandClassName": "No Operation",
|
||||||
|
"commandClass": 0,
|
||||||
|
"testNodeId": 1,
|
||||||
|
"status": 0,
|
||||||
|
"acknowledgedFrames": 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
node.receive_event(event)
|
||||||
|
|
||||||
|
assert not notification_events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user