diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index b5006336029d21..d5356320b24d4c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -258,7 +258,8 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID - (BOOL)_internalState:(NSDictionary *)dictionary hasValidValuesForKeys:(const NSArray *)keys valueRequired:(BOOL)required { - // All the keys are NSNumber-valued. + // At one point, all keys were NSNumber valued; now there are also NSDates. + // TODO: Create a mapping between keys and their expected types and use that in the type check below. for (NSString * key in keys) { id value = dictionary[key]; if (!value) { @@ -269,7 +270,7 @@ - (BOOL)_internalState:(NSDictionary *)dictionary hasValidValuesForKeys:(const N continue; } - if (!MTR_SAFE_CAST(value, NSNumber)) { + if (!MTR_SAFE_CAST(value, NSNumber) && !MTR_SAFE_CAST(value, NSDate)) { MTR_LOG_ERROR("%@ device:internalStateUpdated: handed state with invalid value for \"%@\": %@", self, key, value); return NO; }