Skip to content

Commit

Permalink
some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jun 27, 2023
1 parent e030d67 commit 3e9dc1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,10 @@ async def subscribe_attribute(
if not isinstance(attribute_path, list):
attribute_path = [attribute_path]
attribute_paths = {parse_attribute_path(x) for x in attribute_path}
if not node.attribute_subscriptions.difference(attribute_paths):
return # nothing to do
prev_subs = set(node.attribute_subscriptions)
node.attribute_subscriptions.update(attribute_paths)
if prev_subs == node.attribute_subscriptions:
return # nothing to do
# save updated node data
self.server.storage.set(
DATA_KEY_NODES,
Expand Down Expand Up @@ -489,7 +490,7 @@ async def _subscribe_node(self, node_id: int) -> None:
endpoint_id,
cluster_id,
attribute_id,
) in set.union(DEFAULT_SUBSCRIBE_ATTRIBUTES, *node.attribute_subscriptions):
) in set.union(DEFAULT_SUBSCRIBE_ATTRIBUTES, node.attribute_subscriptions):
endpoint: int | None = None if endpoint_id == "*" else endpoint_id
cluster: Type[Cluster] = ALL_CLUSTERS[cluster_id]
attribute: Type[ClusterAttributeDescriptor] | None = (
Expand Down

0 comments on commit 3e9dc1c

Please sign in to comment.