Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plug devices: Properly set initial power state
‘status’ can get a value of empty string (at least in the case of the Zigbee gateway-based power plugs), which used to get translated to a 'false' power state. This would cause the triggering of the powerChanged event twice on initialisation if the device was on already, with the empty string case being the second call. This would cause users that monitor the ‘powerChanged’ event to falsely report a power plug as off. This fix explicitly allows for the empty string case, and avoids updating the power state in this case.
- Loading branch information