File tree 1 file changed +7
-1
lines changed
src/darwin/Framework/CHIP
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ - (NSString *)description
130
130
wifi,
131
131
thread,
132
132
_deviceController.uniqueIdentifier,
133
- (unsigned long ) self.state ];
133
+ (unsigned long ) [MTR_SAFE_CAST( self._internalState[ kMTRDeviceInternalPropertyDeviceState ], NSNumber ) unsignedLongValue] ];
134
134
}
135
135
136
136
- (nullable NSNumber *)vendorID
@@ -372,8 +372,14 @@ - (void)_updateInternalState:(NSMutableDictionary *)newState
372
372
373
373
- (MTRDeviceState)state
374
374
{
375
+ // TEMPORARY WORKAROUND for UNTIL WE HAVE the addDelegate flow fixed
376
+ if (![self delegateExists ]) {
377
+ return MTRDeviceStateReachable;
378
+ }
379
+
375
380
NSNumber * stateNumber = MTR_SAFE_CAST (self._internalState [kMTRDeviceInternalPropertyDeviceState ], NSNumber );
376
381
switch (static_cast <MTRDeviceState>(stateNumber.unsignedIntegerValue )) {
382
+ default :
377
383
case MTRDeviceStateUnknown:
378
384
return MTRDeviceStateUnknown;
379
385
You can’t perform that action at this time.
0 commit comments