Wrong power state fixed
@@ -400,14 +400,16 @@ class SmartIRClimate(ClimateDevice, RestoreEntity):
if new_state is None:
return
- if new_state.state == STATE_OFF and self._current_operation != STATE_OFF:
- self._current_operation = STATE_OFF
- await self.async_update_ha_state()
-
if new_state.state == STATE_ON and self._current_operation == STATE_OFF:
self._on_by_remote = True
await self.async_update_ha_state()
+ if new_state.state == STATE_OFF:
+ self._on_by_remote = False
+ if self._current_operation != STATE_OFF:
+ self._current_operation = STATE_OFF
+ await self.async_update_ha_state()
+
@callback
def _async_update_temp(self, state):
"""Update thermostat with latest state from temperature sensor."""
