Skip to content

Commit 4370d30

Browse files
committed
fix: add safety check for trait creation
1 parent f541de5 commit 4370d30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

roborock/devices/device.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def __init__(
4747
self._channel = channel
4848
self._unsub: Callable[[], None] | None = None
4949
self._trait_map = {trait.name: trait for trait in traits}
50+
if len(self._trait_map) != len(traits):
51+
raise ValueError("Duplicate trait names found in traits list")
5052

5153
@property
5254
def duid(self) -> str:

0 commit comments

Comments
 (0)