@@ -408,9 +408,14 @@ def UpdateCachedData(self):
408
408
endpointCache = attributeCache [endpoint ]
409
409
410
410
for cluster in tlvCache [endpoint ]:
411
+ if cluster not in _ClusterIndex :
412
+ #
413
+ # #22599 tracks dealing with unknown clusters more
414
+ # gracefully so that clients can still access this data.
415
+ #
416
+ continue
417
+
411
418
clusterType = _ClusterIndex [cluster ]
412
- if (clusterType is None ):
413
- raise Exception ("Cannot find cluster in cluster index" )
414
419
415
420
if (clusterType not in endpointCache ):
416
421
endpointCache [clusterType ] = {}
@@ -427,9 +432,6 @@ def UpdateCachedData(self):
427
432
endpointCache [clusterType ].SetDataVersion (
428
433
clusterDataVersion )
429
434
except Exception as ex :
430
- logging .error (
431
- f"Error converting TLV to Cluster Object for path: Endpoint = { endpoint } , cluster = { str (clusterType )} " )
432
- logging .error (f"|-- Exception: { repr (ex )} " )
433
435
decodedValue = ValueDecodeFailure (
434
436
tlvCache [endpoint ][cluster ], ex )
435
437
endpointCache [clusterType ] = decodedValue
@@ -438,27 +440,26 @@ def UpdateCachedData(self):
438
440
for attribute in tlvCache [endpoint ][cluster ]:
439
441
value = tlvCache [endpoint ][cluster ][attribute ]
440
442
443
+ if (cluster , attribute ) not in _AttributeIndex :
444
+ #
445
+ # #22599 tracks dealing with unknown clusters more
446
+ # gracefully so that clients can still access this data.
447
+ #
448
+ continue
449
+
441
450
attributeType = _AttributeIndex [(
442
451
cluster , attribute )][0 ]
443
- if (attributeType is None ):
444
- raise Exception (
445
- "Cannot find attribute in attribute index" )
446
452
447
453
if (attributeType not in clusterCache ):
448
454
clusterCache [attributeType ] = {}
449
455
450
456
if (type (value ) is ValueDecodeFailure ):
451
- logging .error (
452
- f"For path: Endpoint = { endpoint } , Attribute = { str (attributeType )} , got IM Error: { str (value .Reason )} " )
453
457
clusterCache [attributeType ] = value
454
458
else :
455
459
try :
456
460
decodedValue = attributeType .FromTagDictOrRawValue (
457
461
tlvCache [endpoint ][cluster ][attribute ])
458
462
except Exception as ex :
459
- logging .error (
460
- f"Error converting TLV to Cluster Object for path: Endpoint = { endpoint } , Attribute = { str (attributeType )} " )
461
- logging .error (f"|-- Exception: { repr (ex )} " )
462
463
decodedValue = ValueDecodeFailure (value , ex )
463
464
464
465
clusterCache [attributeType ] = decodedValue
0 commit comments