Skip to content

Commit

Permalink
Some small tweaks to the subscripions logic (#676)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
marcelveldt and MartinHjelmare committed Apr 29, 2024
1 parent 7b032fc commit b021322
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions matter_server/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ..common.helpers.util import (
convert_ip_address,
convert_mac_address,
create_attribute_path_from_attribute,
dataclass_from_dict,
dataclass_to_dict,
)
Expand Down Expand Up @@ -218,6 +219,16 @@ async def get_matter_fabrics(self, node_id: int) -> list[MatterFabricData]:
"""

node = self.get_node(node_id)

# refresh node's fabrics if the node is available so we have the latest info
if node.available:
await self.refresh_attribute(
node_id,
create_attribute_path_from_attribute(
0, Clusters.OperationalCredentials.Attributes.Fabrics
),
)

fabrics: list[
Clusters.OperationalCredentials.Structs.FabricDescriptorStruct
] = node.get_attribute_value(
Expand Down
4 changes: 1 addition & 3 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
DATA_KEY_LAST_NODE_ID = "last_node_id"

LOGGER = logging.getLogger(__name__)
NODE_SUBSCRIPTION_CEILING_WIFI = 30
NODE_SUBSCRIPTION_CEILING_WIFI = 60
NODE_SUBSCRIPTION_CEILING_THREAD = 60
NODE_SUBSCRIPTION_CEILING_BATTERY_POWERED = 600
MAX_COMMISSION_RETRIES = 3
Expand Down Expand Up @@ -1090,8 +1090,6 @@ def resubscription_succeeded(
events=[("*", 1)],
returnClusterObject=False,
reportInterval=(interval_floor, interval_ceiling),
fabricFiltered=False,
keepSubscriptions=True,
autoResubscribe=True,
)

Expand Down

0 comments on commit b021322

Please sign in to comment.