Skip to content

Commit

Permalink
Change subscription floor to 1 second to prevent flooding (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Sep 19, 2024
1 parent 0376098 commit 8328190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
DATA_KEY_LAST_NODE_ID = "last_node_id"

LOGGER = logging.getLogger(__name__)
NODE_SUBSCRIPTION_FLOOR = 1
NODE_SUBSCRIPTION_CEILING_WIFI = 60
NODE_SUBSCRIPTION_CEILING_THREAD = 60
NODE_SUBSCRIPTION_CEILING_BATTERY_POWERED = 600
Expand Down Expand Up @@ -1221,7 +1222,6 @@ def resubscription_succeeded(
self.server.signal_event(EventType.NODE_UPDATED, node)

node_logger.info("Setting up attributes and events subscription.")
interval_floor = 0
# determine subscription ceiling based on routing role
# Endpoint 0, ThreadNetworkDiagnostics Cluster, routingRole attribute
# for WiFi devices, this cluster doesn't exist.
Expand All @@ -1244,7 +1244,7 @@ def resubscription_succeeded(
[()],
events=[("*", 1)],
return_cluster_objects=False,
report_interval=(interval_floor, interval_ceiling),
report_interval=(NODE_SUBSCRIPTION_FLOOR, interval_ceiling),
auto_resubscribe=True,
)
)
Expand Down

0 comments on commit 8328190

Please sign in to comment.