Skip to content

Commit

Permalink
Use interval floor of 0 for ICD devices
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Sep 19, 2024
1 parent 8328190 commit 103559d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
0, Clusters.BasicInformation.Attributes.SoftwareVersionString
)
)
ICD_ATTR_LIST_ATTRIBUTE_PATH = create_attribute_path_from_attribute(
0, Clusters.IcdManagement.Attributes.AttributeList
)


# pylint: disable=too-many-lines,too-many-instance-attributes,too-many-public-methods
Expand Down Expand Up @@ -1236,6 +1239,13 @@ def resubscription_succeeded(
interval_ceiling = NODE_SUBSCRIPTION_CEILING_BATTERY_POWERED
else:
interval_ceiling = NODE_SUBSCRIPTION_CEILING_THREAD
if node.attributes.get(ICD_ATTR_LIST_ATTRIBUTE_PATH) is not None:
# for ICD devices, the interval floor must be 0 according to the spec,
# to prevent additional battery drainage. See Matter core spec, chapter 8.5.2.2.
# TODO: revisit this after Matter 1.4 release (as that mighht change this again).
interval_floor = 0
else:
interval_floor = NODE_SUBSCRIPTION_FLOOR
self._resubscription_attempt[node_id] = 0
# set-up the actual subscription
sub: Attribute.SubscriptionTransaction = (
Expand All @@ -1244,7 +1254,7 @@ def resubscription_succeeded(
[()],
events=[("*", 1)],
return_cluster_objects=False,
report_interval=(NODE_SUBSCRIPTION_FLOOR, interval_ceiling),
report_interval=(interval_floor, interval_ceiling),
auto_resubscribe=True,
)
)
Expand Down

0 comments on commit 103559d

Please sign in to comment.