From b021322d87fcd0daebf23e36e752b5206ae2c716 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 29 Apr 2024 12:48:49 +0200 Subject: [PATCH] Some small tweaks to the subscripions logic (#676) Co-authored-by: Martin Hjelmare --- matter_server/client/client.py | 11 +++++++++++ matter_server/server/device_controller.py | 4 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/matter_server/client/client.py b/matter_server/client/client.py index 405b247b..ff499ff9 100644 --- a/matter_server/client/client.py +++ b/matter_server/client/client.py @@ -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, ) @@ -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( diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index 1286b051..fc80f36b 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -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 @@ -1090,8 +1090,6 @@ def resubscription_succeeded( events=[("*", 1)], returnClusterObject=False, reportInterval=(interval_floor, interval_ceiling), - fabricFiltered=False, - keepSubscriptions=True, autoResubscribe=True, )