Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions custom_components/smartir/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
_LOGGER.error("Unable to update from humidity sensor: %s", ex)