Skip to content

Commit bb700de

Browse files
committed
Process Shutdown events
Mark the node as offline when we receive a explicit Shutdown event from the node. This avoids that the node remains appearing online after an update for the full subscription report interval before realizing that the node disappeared and subscriptions get setup again. Most likely this helps in other cases too.
1 parent e3b5f23 commit bb700de

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

matter_server/server/device_controller.py

+3
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,9 @@ def event_callback(
10871087
)
10881088
self.event_history.append(node_event)
10891089

1090+
if isinstance(data.Data, Clusters.BasicInformation.Events.ShutDown):
1091+
asyncio.run_coroutine_threadsafe(self._node_offline(node_id), loop)
1092+
10901093
loop.call_soon_threadsafe(
10911094
self.server.signal_event, EventType.NODE_EVENT, node_event
10921095
)

0 commit comments

Comments
 (0)