@@ -3441,6 +3441,13 @@ - (void)_pruneEndpointsIn:(MTRDeviceDataValueDictionary)previousPartsListValue
3441
3441
}
3442
3442
[self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:NO];
3443
3443
[self.deviceController.controllerDataStore clearStoredClusterDataForNodeID:self.nodeID endpointID:endpoint];
3444
+
3445
+ [_deviceController asyncDispatchToMatterQueue:^{
3446
+ std::lock_guard lock(self->_lock);
3447
+ if (self->_currentSubscriptionCallback) {
3448
+ self->_currentSubscriptionCallback->ClearCachedAttributeState(static_cast<EndpointId>(endpoint.unsignedLongLongValue));
3449
+ }
3450
+ } errorHandler:nil];
3444
3451
}
3445
3452
}
3446
3453
@@ -3461,6 +3468,17 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue
3461
3468
}
3462
3469
}
3463
3470
[self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:YES];
3471
+
3472
+ [_deviceController asyncDispatchToMatterQueue:^{
3473
+ std::lock_guard lock(self->_lock);
3474
+ if (self->_currentSubscriptionCallback) {
3475
+ for (NSNumber * cluster in toBeRemovedClusters) {
3476
+ ConcreteClusterPath clusterPath(static_cast<EndpointId>(endpointID.unsignedLongLongValue),
3477
+ static_cast<ClusterId>(cluster.unsignedLongLongValue));
3478
+ self->_currentSubscriptionCallback->ClearCachedAttributeState(clusterPath);
3479
+ }
3480
+ }
3481
+ } errorHandler:nil];
3464
3482
}
3465
3483
3466
3484
- (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListValue
@@ -3474,6 +3492,18 @@ - (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListVa
3474
3492
3475
3493
[toBeRemovedAttributes minusSet:attributesStillInCluster];
3476
3494
[self _removeAttributes:toBeRemovedAttributes fromCluster:clusterPath];
3495
+
3496
+ [_deviceController asyncDispatchToMatterQueue:^{
3497
+ std::lock_guard lock(self->_lock);
3498
+ if (self->_currentSubscriptionCallback) {
3499
+ for (NSNumber * attribute in toBeRemovedAttributes) {
3500
+ ConcreteAttributePath attributePath(static_cast<EndpointId>(clusterPath.endpoint.unsignedLongLongValue),
3501
+ static_cast<ClusterId>(clusterPath.cluster.unsignedLongLongValue),
3502
+ static_cast<AttributeId>(attribute.unsignedLongLongValue));
3503
+ self->_currentSubscriptionCallback->ClearCachedAttributeState(attributePath);
3504
+ }
3505
+ }
3506
+ } errorHandler:nil];
3477
3507
}
3478
3508
3479
3509
- (void)_pruneStoredDataForPath:(MTRAttributePath *)attributePath
0 commit comments