Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat mdns update events as add events as safeguard #536

Merged
merged 1 commit into from
Feb 7, 2024
Merged
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
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
Loading