proper restored state checking
@@ -1030,7 +1030,7 @@ class SwitchingSensor(RestoreEntity):
if not old_state:
self.ready_for_update = True
return
- self._state = True if old_state.state == "on" else False
+ self._state = True if old_state.state == STATE_ON else False
if "ext_state" in old_state.attributes:
self._device_state_attributes["ext_state"] = old_state.attributes["ext_state"]
if "rssi" in old_state.attributes:
