From 6834357fb13c1e028ab969ded62740051339dc1e Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 1 Mar 2024 11:34:02 +0100 Subject: [PATCH] add semaphore for concurrent node setups --- matter_server/server/device_controller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index 5ddaf316..87fdbe70 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -591,12 +591,13 @@ async def read_attribute( if TYPE_CHECKING: assert self.server.loop assert self.chip_controller - loop = self.server.loop - future = loop.create_future() + + future = self.server.loop.create_future() + device = await self._resolve_node(node_id) Attribute.Read( future=future, - eventLoop=loop, - device=device, + eventLoop=self.server.loop, + device=device.deviceProxy, devCtrl=self.chip_controller, attributes=[ Attribute.AttributePath( @@ -607,7 +608,6 @@ async def read_attribute( ], fabricFiltered=fabric_filtered, ).raise_on_error() - result: Attribute.AsyncReadTransaction.ReadResponse = await future read_atributes = parse_attributes_from_read_result(result.tlvAttributes) # update cached info in node attributes