Skip to content

Commit babcc04

Browse files
committed
Explicitly cast the return values to avoid pylint errors
1 parent 3892260 commit babcc04

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

matter_server/server/sdk.py

+22-13
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,13 @@ async def commission_with_code(
119119
discovery_type: DiscoveryType,
120120
) -> int:
121121
"""Commission a device using a QR Code or Manual Pairing Code."""
122-
return await self._chip_controller.CommissionWithCode(
123-
setupPayload=setup_payload,
124-
nodeid=node_id,
125-
discoveryType=discovery_type,
122+
return cast(
123+
int,
124+
await self._chip_controller.CommissionWithCode(
125+
setupPayload=setup_payload,
126+
nodeid=node_id,
127+
discoveryType=discovery_type,
128+
),
126129
)
127130

128131
async def commission_on_network(
@@ -133,21 +136,27 @@ async def commission_on_network(
133136
disc_filter: Any = None,
134137
) -> int:
135138
"""Commission a device on the network."""
136-
return await self._chip_controller.CommissionOnNetwork(
137-
nodeId=node_id,
138-
setupPinCode=setup_pin_code,
139-
filterType=disc_filter_type,
140-
filter=disc_filter,
139+
return cast(
140+
int,
141+
await self._chip_controller.CommissionOnNetwork(
142+
nodeId=node_id,
143+
setupPinCode=setup_pin_code,
144+
filterType=disc_filter_type,
145+
filter=disc_filter,
146+
),
141147
)
142148

143149
async def commission_ip(
144150
self, node_id: int, setup_pin_code: int, ip_addr: str
145151
) -> int:
146152
"""Commission a device using an IP address."""
147-
return await self._chip_controller.CommissionIP(
148-
nodeid=node_id,
149-
setupPinCode=setup_pin_code,
150-
ipaddr=ip_addr,
153+
return cast(
154+
int,
155+
await self._chip_controller.CommissionIP(
156+
nodeid=node_id,
157+
setupPinCode=setup_pin_code,
158+
ipaddr=ip_addr,
159+
),
151160
)
152161

153162
async def set_wifi_credentials(self, ssid: str, credentials: str) -> None:

0 commit comments

Comments
 (0)