Skip to content

Commit

Permalink
Add endpoint to zwave_js_notification event (#100951)
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 authored Sep 26, 2023
1 parent 8a9b2f4 commit 65f307f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/zwave_js/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ def async_on_notification(self, event: dict[str, Any]) -> None:
ATTR_DOMAIN: DOMAIN,
ATTR_NODE_ID: notification.node.node_id,
ATTR_HOME_ID: driver.controller.home_id,
ATTR_ENDPOINT: notification.endpoint_idx,
ATTR_DEVICE_ID: device.id,
ATTR_COMMAND_CLASS: notification.command_class,
}
Expand Down
3 changes: 3 additions & 0 deletions tests/components/zwave_js/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ async def test_notifications(
assert len(events) == 1
assert events[0].data["home_id"] == client.driver.controller.home_id
assert events[0].data["node_id"] == 32
assert events[0].data["endpoint"] == 0
assert events[0].data["type"] == 6
assert events[0].data["event"] == 5
assert events[0].data["label"] == "Access Control"
Expand Down Expand Up @@ -206,6 +207,7 @@ async def test_notifications(
assert len(events) == 2
assert events[1].data["home_id"] == client.driver.controller.home_id
assert events[1].data["node_id"] == 32
assert events[0].data["endpoint"] == 0
assert events[1].data["event_type"] == 5
assert events[1].data["event_type_label"] == "test1"
assert events[1].data["data_type"] == 2
Expand Down Expand Up @@ -233,6 +235,7 @@ async def test_notifications(
assert len(events) == 3
assert events[2].data["home_id"] == client.driver.controller.home_id
assert events[2].data["node_id"] == 32
assert events[0].data["endpoint"] == 0
assert events[2].data["event_type"] == 4
assert events[2].data["event_type_label"] == "test1"
assert events[2].data["direction"] == "up"
Expand Down

0 comments on commit 65f307f

Please sign in to comment.