From 89cf31ff61397da3c2879dde346664a929317f03 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 29 May 2024 16:33:58 +0200 Subject: [PATCH] Fix arguments in ChipDeviceControllerWrapper (#725) --- matter_server/server/sdk.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/matter_server/server/sdk.py b/matter_server/server/sdk.py index 8cffd752..8eb37e46 100644 --- a/matter_server/server/sdk.py +++ b/matter_server/server/sdk.py @@ -15,6 +15,7 @@ from chip.clusters import Attribute, Objects as Clusters from chip.clusters.Attribute import AttributeWriteResult +from chip.discovery import FilterType from chip.exceptions import ChipStackError from ..common.errors import ( @@ -30,7 +31,7 @@ CommissioningParameters, DeviceProxyWrapper, ) - from chip.discovery import DiscoveryType, FilterType + from chip.discovery import DiscoveryType from chip.native import PyChipError from .server import MatterServer @@ -119,13 +120,13 @@ async def commission_on_network( self, node_id: int, setup_pin_code: int, - disc_filter_type: FilterType, - disc_filter: Any, + disc_filter_type: FilterType = FilterType.NONE, + disc_filter: Any = None, ) -> PyChipError: """Commission a device on the network.""" return await self._call_sdk( self._chip_controller.CommissionOnNetwork, - nodeid=node_id, + nodeId=node_id, setupPinCode=setup_pin_code, filterType=disc_filter_type, filter=disc_filter, @@ -230,7 +231,11 @@ async def read_attribute( report_interval: tuple[int, int] | None = None, fabric_filtered: bool = True, auto_resubscribe: bool = True, - ) -> Attribute.SubscriptionTransaction | Any | None: + ) -> ( + Attribute.SubscriptionTransaction + | Attribute.AsyncReadTransaction.ReadResponse + | None + ): """Read an attribute on a node.""" async with self._get_node_lock(node_id): result = await self._chip_controller.Read(