Skip to content

Commit

Permalink
Treat mdns update events as add events as safeguard (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt authored Feb 7, 2024
1 parent d5d16ae commit d122be4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,6 @@ def _on_mdns_service_state_change(
name: str,
state_change: ServiceStateChange,
) -> None:
if state_change not in (ServiceStateChange.Added, ServiceStateChange.Removed):
# we're not interested in update messages so return early
return
if service_type == MDNS_TYPE_COMMISSIONABLE_NODE:
asyncio.create_task(
self._on_mdns_commissionable_node_state(name, state_change)
Expand All @@ -1211,7 +1208,7 @@ async def _on_mdns_operational_node_state(
try:
self._mdns_inprogress.add(node_id)
node = self._nodes[node_id]
if state_change == ServiceStateChange.Added:
if state_change in (ServiceStateChange.Added, ServiceStateChange.Updated):
if node.available:
return # node is already set-up, no action needed
LOGGER.info("Node %s discovered on MDNS", node_id)
Expand Down

0 comments on commit d122be4

Please sign in to comment.