Skip to content
Merged
Changes from 1 commit
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
24 changes: 15 additions & 9 deletions homeassistant/components/climate/generic_thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,21 @@ def is_away_mode_on(self):

async def async_turn_away_mode_on(self):
"""Turn away mode on by setting it on away hold indefinitely."""
self._is_away = True
self._saved_target_temp = self._target_temp
self._target_temp = self._away_temp
await self._async_control_heating()
await self.async_update_ha_state()
if not self._is_away:
Comment thread
estevez-dev marked this conversation as resolved.
Outdated
self._is_away = True
self._saved_target_temp = self._target_temp
self._target_temp = self._away_temp
await self._async_control_heating()
await self.async_update_ha_state()
else:
_LOGGER.debug("Away mode is already turned on for %s", self.entity_id)
Comment thread
estevez-dev marked this conversation as resolved.
Outdated

async def async_turn_away_mode_off(self):
"""Turn away off."""
self._is_away = False
self._target_temp = self._saved_target_temp
await self._async_control_heating()
await self.async_update_ha_state()
if self._is_away:
Comment thread
estevez-dev marked this conversation as resolved.
Outdated
self._is_away = False
self._target_temp = self._saved_target_temp
await self._async_control_heating()
await self.async_update_ha_state()
else:
_LOGGER.debug("Away mode is already turned off for %s", self.entity_id)
Comment thread
estevez-dev marked this conversation as resolved.
Outdated