File tree 1 file changed +5
-4
lines changed
src/darwin/Framework/CHIP
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2344,19 +2344,20 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray<NSDictionary<NSSt
2344
2344
}
2345
2345
NSArray * expectedValue = _expectedValueCache[attributePath];
2346
2346
2347
- // Report the attribute if read attribute would get a value that is changing and no expected value exists.
2347
+ // Report the attribute if a read would get a changed value. This happens
2348
+ // when our cached value changes and no expected value exists.
2348
2349
if (readCacheValueChanged && !expectedValue) {
2349
2350
previousValue = _readCache[attributePath];
2350
2351
shouldReportAttribute = YES ;
2351
2352
}
2352
2353
2353
- // Update the readCache with the attribute value.
2354
+ // Now that we have grabbed previousValue, update the readCache with the attribute value.
2354
2355
_readCache[attributePath] = attributeDataValue;
2355
2356
2356
2357
if (!shouldReportAttribute) {
2357
-
2358
2358
// If an expected value exists, the attribute will not be reported at this time.
2359
- // When the expected value interval expires, the correct value will be reported.
2359
+ // When the expected value interval expires, the correct value will be reported,
2360
+ // if needed.
2360
2361
if (expectedValue) {
2361
2362
MTR_LOG_INFO (" %@ report %@ value filtered - expected value still present" , self, attributePath);
2362
2363
} else
You can’t perform that action at this time.
0 commit comments