Skip to content

Commit 267cf3f

Browse files
authored
Fix small typo in attempt count (#534)
1 parent 49290b1 commit 267cf3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

matter_server/server/device_controller.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ async def commission_with_code(
228228
# that are a bit unstable.
229229
# by retrying, we increase the chances of a successful commisssion
230230
while attempts <= MAX_COMMISSION_RETRIES:
231+
attempts += 1
231232
LOGGER.info(
232233
"Starting Matter commissioning with code using Node ID %s (attempt %s/%s).",
233234
node_id,
@@ -247,7 +248,7 @@ async def commission_with_code(
247248
f"Commission with code failed for node {node_id}."
248249
)
249250
await asyncio.sleep(5)
250-
attempts += 1
251+
251252
LOGGER.info("Matter commissioning of Node ID %s successful.", node_id)
252253

253254
# perform full (first) interview of the device
@@ -305,6 +306,7 @@ async def commission_on_network(
305306
# that are a bit unstable.
306307
# by retrying, we increase the chances of a successful commisssion
307308
while attempts <= MAX_COMMISSION_RETRIES:
309+
attempts += 1
308310
if ip_addr is None:
309311
# regular CommissionOnNetwork if no IP address provided
310312
LOGGER.info(
@@ -339,7 +341,6 @@ async def commission_on_network(
339341
if not success and attempts >= MAX_COMMISSION_RETRIES:
340342
raise NodeCommissionFailed(f"Commissioning failed for node {node_id}.")
341343
await asyncio.sleep(5)
342-
attempts += 1
343344

344345
LOGGER.info("Matter commissioning of Node ID %s successful.", node_id)
345346

0 commit comments

Comments
 (0)