Skip to content

Commit 316f9d0

Browse files
committed
generate random discriminator
1 parent f8a72db commit 316f9d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matter_server/server/device_controller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datetime import datetime
1010
from functools import partial
1111
import logging
12+
from random import randint
1213
import time
1314
from typing import TYPE_CHECKING, Any, Callable, Iterable, TypeVar, cast
1415

@@ -410,7 +411,7 @@ async def open_commissioning_window(
410411
return self._known_commissioning_params[node_id]
411412

412413
if discriminator is None:
413-
discriminator = 3840 # TODO generate random one
414+
discriminator = randint(1000, 4096) # noqa: S311
414415

415416
sdk_result = await self._call_sdk(
416417
self.chip_controller.OpenCommissioningWindow,

0 commit comments

Comments
 (0)