Skip to content

Commit

Permalink
adjust node last seen logic a tiny bit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Feb 28, 2024
1 parent ed19943 commit dfb1485
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,11 @@ def _on_mdns_operational_node_state(
# mdns events for matter devices arrive in bursts of (duplicate) messages
# so we debounce this as we only use the mdns messages for operational node discovery
# and we have other logic in place to determine node aliveness
now = time.time()
last_seen = self._node_last_seen.get(node_id, 0)
if node.available and time.time() - last_seen < MAX_NODE_SUBSCRIPTION_CEILING:
if node.available and now - last_seen < 60:
return
self._node_last_seen[node_id] = now

# we treat UPDATE state changes as ADD if the node is marked as
# unavailable to ensure we catch a node being operational
Expand Down

0 comments on commit dfb1485

Please sign in to comment.