Skip to content

Commit 52ab3db

Browse files
authoredFeb 23, 2024
TC-IDM-10.1: Fix guard around non-standard attributes (#32231)
1 parent c49e784 commit 52ab3db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/controller/python/chip/clusters/ClusterObjects.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,11 @@ def __init_subclass__(cls, *args, **kwargs) -> None:
301301
"""Register a subclass."""
302302
super().__init_subclass__(*args, **kwargs)
303303
try:
304-
if cls.standard_attribute and cls.cluster_id not in ALL_ATTRIBUTES:
305-
ALL_ATTRIBUTES[cls.cluster_id] = {}
306-
# register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
307-
ALL_ATTRIBUTES[cls.cluster_id][cls.attribute_id] = cls
304+
if cls.standard_attribute:
305+
if cls.cluster_id not in ALL_ATTRIBUTES:
306+
ALL_ATTRIBUTES[cls.cluster_id] = {}
307+
# register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
308+
ALL_ATTRIBUTES[cls.cluster_id][cls.attribute_id] = cls
308309
except NotImplementedError:
309310
# handle case where the ClusterAttribute class is not (fully) subclassed
310311
# and accessing the id property throws a NotImplementedError.

0 commit comments

Comments
 (0)