diff --git a/custom_components/smartir/climate.py b/custom_components/smartir/climate.py index f59fe46b0..7d2e6c8e4 100644 --- a/custom_components/smartir/climate.py +++ b/custom_components/smartir/climate.py @@ -425,7 +425,11 @@ async def _async_power_sensor_changed(self, event: Event[EventStateChangedData]) if self._power_sensor_restore_state == True and self._last_on_operation is not None: self._hvac_mode = self._last_on_operation else: - self._hvac_mode = STATE_ON + self._hvac_mode = ( + self._operation_modes[1] + if len(self._operation_modes) > 1 + else HVACMode.OFF + ) self.async_write_ha_state() @@ -451,4 +455,4 @@ def _async_update_humidity(self, state): if state.state != STATE_UNKNOWN and state.state != STATE_UNAVAILABLE: self._current_humidity = float(state.state) except ValueError as ex: - _LOGGER.error("Unable to update from humidity sensor: %s", ex) \ No newline at end of file + _LOGGER.error("Unable to update from humidity sensor: %s", ex)