From e1f50b6df9fdfbc960de9ba8f2beac0cd137c173 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 18 Sep 2024 11:46:41 +0200 Subject: [PATCH] Update to Matter SDK wheels 2024.9.0 The 2024.9.0 wheels come with an improved attribute cache handling: The Attribute cache only gets updated when actually uesd. This will save Attribute cache updates in Subscriptions typically, and moves Attribute cache updates for reads out of the SDK thread. --- matter_server/server/sdk.py | 10 ++++++---- pyproject.toml | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/matter_server/server/sdk.py b/matter_server/server/sdk.py index 3485c371..3add3f83 100644 --- a/matter_server/server/sdk.py +++ b/matter_server/server/sdk.py @@ -338,15 +338,17 @@ async def read( allowPASE=False, timeoutMs=None, ) + transaction = Attribute.AsyncReadTransaction( + future, self.server.loop, self._chip_controller, True + ) Attribute.Read( - future=future, - eventLoop=self.server.loop, + transaction=transaction, device=device.deviceProxy, - devCtrl=self._chip_controller, attributes=attributes, fabricFiltered=fabric_filtered, ).raise_on_error() - return await future + await future + return transaction.GetReadResponse() async def write_attribute( self, diff --git a/pyproject.toml b/pyproject.toml index b79a65ed..faad52ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "async-timeout", "coloredlogs", "orjson", - "home-assistant-chip-clusters==2024.7.1", + "home-assistant-chip-clusters==2024.9.0", ] description = "Python Matter WebSocket Server" license = {text = "Apache-2.0"} @@ -39,7 +39,7 @@ server = [ "cryptography==43.0.1", "orjson==3.10.7", "zeroconf==0.134.0", - "home-assistant-chip-core==2024.7.1", + "home-assistant-chip-core==2024.9.0", ] test = [ "aioresponses==0.7.6",