Skip to content

Commit 89cf31f

Browse files
authored
Fix arguments in ChipDeviceControllerWrapper (#725)
1 parent dd8f9bf commit 89cf31f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

matter_server/server/sdk.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from chip.clusters import Attribute, Objects as Clusters
1717
from chip.clusters.Attribute import AttributeWriteResult
18+
from chip.discovery import FilterType
1819
from chip.exceptions import ChipStackError
1920

2021
from ..common.errors import (
@@ -30,7 +31,7 @@
3031
CommissioningParameters,
3132
DeviceProxyWrapper,
3233
)
33-
from chip.discovery import DiscoveryType, FilterType
34+
from chip.discovery import DiscoveryType
3435
from chip.native import PyChipError
3536

3637
from .server import MatterServer
@@ -119,13 +120,13 @@ async def commission_on_network(
119120
self,
120121
node_id: int,
121122
setup_pin_code: int,
122-
disc_filter_type: FilterType,
123-
disc_filter: Any,
123+
disc_filter_type: FilterType = FilterType.NONE,
124+
disc_filter: Any = None,
124125
) -> PyChipError:
125126
"""Commission a device on the network."""
126127
return await self._call_sdk(
127128
self._chip_controller.CommissionOnNetwork,
128-
nodeid=node_id,
129+
nodeId=node_id,
129130
setupPinCode=setup_pin_code,
130131
filterType=disc_filter_type,
131132
filter=disc_filter,
@@ -230,7 +231,11 @@ async def read_attribute(
230231
report_interval: tuple[int, int] | None = None,
231232
fabric_filtered: bool = True,
232233
auto_resubscribe: bool = True,
233-
) -> Attribute.SubscriptionTransaction | Any | None:
234+
) -> (
235+
Attribute.SubscriptionTransaction
236+
| Attribute.AsyncReadTransaction.ReadResponse
237+
| None
238+
):
234239
"""Read an attribute on a node."""
235240
async with self._get_node_lock(node_id):
236241
result = await self._chip_controller.Read(

0 commit comments

Comments
 (0)