Skip to content

Commit

Permalink
Fix arguments in ChipDeviceControllerWrapper (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed May 29, 2024
1 parent dd8f9bf commit 89cf31f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions matter_server/server/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 89cf31f

Please sign in to comment.