Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions homeassistant/components/matter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,24 @@ def node_removed_callback(event: EventType, node_id: int) -> None:
)

self.config_entry.async_on_unload(
self.matter_client.subscribe(
self.matter_client.subscribe_events(
endpoint_added_callback, EventType.ENDPOINT_ADDED
)
)
self.config_entry.async_on_unload(
self.matter_client.subscribe(
self.matter_client.subscribe_events(
endpoint_removed_callback, EventType.ENDPOINT_REMOVED
)
)
self.config_entry.async_on_unload(
self.matter_client.subscribe(node_removed_callback, EventType.NODE_REMOVED)
self.matter_client.subscribe_events(
node_removed_callback, EventType.NODE_REMOVED
)
)
self.config_entry.async_on_unload(
self.matter_client.subscribe(node_added_callback, EventType.NODE_ADDED)
self.matter_client.subscribe_events(
node_added_callback, EventType.NODE_ADDED
)
)

def _setup_node(self, node: MatterNode) -> None:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/matter/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def async_added_to_hass(self) -> None:
self._attributes_map[attr_cls] = attr_path
sub_paths.append(attr_path)
self._unsubscribes.append(
self.matter_client.subscribe(
self.matter_client.subscribe_events(
callback=self._on_matter_event,
event_filter=EventType.ATTRIBUTE_UPDATED,
node_filter=self._endpoint.node.node_id,
Expand All @@ -93,7 +93,7 @@ async def async_added_to_hass(self) -> None:
)
# subscribe to node (availability changes)
self._unsubscribes.append(
self.matter_client.subscribe(
self.matter_client.subscribe_events(
callback=self._on_matter_event,
event_filter=EventType.NODE_UPDATED,
node_filter=self._endpoint.node.node_id,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/matter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"dependencies": ["websocket_api"],
"documentation": "https://www.home-assistant.io/integrations/matter",
"iot_class": "local_push",
"requirements": ["python-matter-server==3.6.0"]
"requirements": ["python-matter-server==3.6.3"]
Comment thread
MartinHjelmare marked this conversation as resolved.
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ python-kasa==0.5.1
# python-lirc==1.2.3

# homeassistant.components.matter
python-matter-server==3.6.0
python-matter-server==3.6.3

# homeassistant.components.xiaomi_miio
python-miio==0.5.12
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ python-juicenet==1.1.0
python-kasa==0.5.1

# homeassistant.components.matter
python-matter-server==3.6.0
python-matter-server==3.6.3

# homeassistant.components.xiaomi_miio
python-miio==0.5.12
Expand Down
2 changes: 1 addition & 1 deletion tests/components/matter/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ async def trigger_subscription_callback(
data: Any = None,
) -> None:
"""Trigger a subscription callback."""
callback = client.subscribe.call_args.kwargs["callback"]
callback = client.subscribe_events.call_args.kwargs["callback"]
callback(event, data)
await hass.async_block_till_done()
6 changes: 3 additions & 3 deletions tests/components/matter/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ async def test_node_added_subscription(
integration: MagicMock,
) -> None:
"""Test subscription to new devices work."""
assert matter_client.subscribe.call_count == 4
assert matter_client.subscribe.call_args[0][1] == EventType.NODE_ADDED
assert matter_client.subscribe_events.call_count == 4
assert matter_client.subscribe_events.call_args[0][1] == EventType.NODE_ADDED

node_added_callback = matter_client.subscribe.call_args[0][0]
node_added_callback = matter_client.subscribe_events.call_args[0][0]
node_data = load_and_parse_node_fixture("onoff-light")
node = MatterNode(
dataclass_from_dict(
Expand Down