Skip to content

Commit 6834357

Browse files
committed
add semaphore for concurrent node setups
1 parent a7e1ad0 commit 6834357

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

matter_server/server/device_controller.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,13 @@ async def read_attribute(
591591
if TYPE_CHECKING:
592592
assert self.server.loop
593593
assert self.chip_controller
594-
loop = self.server.loop
595-
future = loop.create_future()
594+
595+
future = self.server.loop.create_future()
596+
device = await self._resolve_node(node_id)
596597
Attribute.Read(
597598
future=future,
598-
eventLoop=loop,
599-
device=device,
599+
eventLoop=self.server.loop,
600+
device=device.deviceProxy,
600601
devCtrl=self.chip_controller,
601602
attributes=[
602603
Attribute.AttributePath(
@@ -607,7 +608,6 @@ async def read_attribute(
607608
],
608609
fabricFiltered=fabric_filtered,
609610
).raise_on_error()
610-
611611
result: Attribute.AsyncReadTransaction.ReadResponse = await future
612612
read_atributes = parse_attributes_from_read_result(result.tlvAttributes)
613613
# update cached info in node attributes

0 commit comments

Comments
 (0)