@@ -262,12 +262,7 @@ def __init_subclass__(cls, *args, **kwargs) -> None:
262
262
"""Register a subclass."""
263
263
super ().__init_subclass__ (* args , ** kwargs )
264
264
# register this cluster in the ALL_CLUSTERS dict for quick lookups
265
- try :
266
- ALL_CLUSTERS [cls .id ] = cls
267
- except NotImplementedError :
268
- # handle case where the Cluster class is not (fully) subclassed
269
- # and accessing the id property throws a NotImplementedError.
270
- pass
265
+ ALL_CLUSTERS [cls .id ] = cls
271
266
272
267
@property
273
268
def data_version (self ) -> int :
@@ -301,16 +296,11 @@ class ClusterAttributeDescriptor:
301
296
def __init_subclass__ (cls , * args , ** kwargs ) -> None :
302
297
"""Register a subclass."""
303
298
super ().__init_subclass__ (* args , ** kwargs )
304
- try :
305
- if cls .standard_attribute :
306
- if cls .cluster_id not in ALL_ATTRIBUTES :
307
- ALL_ATTRIBUTES [cls .cluster_id ] = {}
308
- # register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
309
- ALL_ATTRIBUTES [cls .cluster_id ][cls .attribute_id ] = cls
310
- except NotImplementedError :
311
- # handle case where the ClusterAttribute class is not (fully) subclassed
312
- # and accessing the id property throws a NotImplementedError.
313
- pass
299
+ if cls .standard_attribute :
300
+ if cls .cluster_id not in ALL_ATTRIBUTES :
301
+ ALL_ATTRIBUTES [cls .cluster_id ] = {}
302
+ # register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
303
+ ALL_ATTRIBUTES [cls .cluster_id ][cls .attribute_id ] = cls
314
304
315
305
@classmethod
316
306
def ToTLV (cls , tag : Union [int , None ], value ):
@@ -373,15 +363,11 @@ class ClusterEvent(ClusterObject):
373
363
def __init_subclass__ (cls , * args , ** kwargs ) -> None :
374
364
"""Register a subclass."""
375
365
super ().__init_subclass__ (* args , ** kwargs )
376
- try :
377
- if cls .cluster_id not in ALL_EVENTS :
378
- ALL_EVENTS [cls .cluster_id ] = {}
379
- # register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
380
- ALL_EVENTS [cls .cluster_id ][cls .event_id ] = cls
381
- except NotImplementedError :
382
- # handle case where the ClusterAttribute class is not (fully) subclassed
383
- # and accessing the id property throws a NotImplementedError.
384
- pass
366
+
367
+ if cls .cluster_id not in ALL_EVENTS :
368
+ ALL_EVENTS [cls .cluster_id ] = {}
369
+ # register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups
370
+ ALL_EVENTS [cls .cluster_id ][cls .event_id ] = cls
385
371
386
372
@ChipUtility .classproperty
387
373
def cluster_id (self ) -> int :
0 commit comments