mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Add turn_on method to ecobee climate platform (#27103)
* Add turn on method to ecobee climate * Update climate.py * Update value in async_update * Fix update in async_update * Simplify async_update * Fix lint complaining about log string * Cleanup inline if statement
This commit is contained in:
parent
7e7868f0a6
commit
2e49303401
@ -264,6 +264,7 @@ class Thermostat(ClimateDevice):
|
|||||||
self.thermostat = self.data.ecobee.get_thermostat(self.thermostat_index)
|
self.thermostat = self.data.ecobee.get_thermostat(self.thermostat_index)
|
||||||
self._name = self.thermostat["name"]
|
self._name = self.thermostat["name"]
|
||||||
self.vacation = None
|
self.vacation = None
|
||||||
|
self._last_active_hvac_mode = HVAC_MODE_AUTO
|
||||||
|
|
||||||
self._operation_list = []
|
self._operation_list = []
|
||||||
if self.thermostat["settings"]["heatStages"]:
|
if self.thermostat["settings"]["heatStages"]:
|
||||||
@ -289,6 +290,8 @@ class Thermostat(ClimateDevice):
|
|||||||
else:
|
else:
|
||||||
await self.data.update()
|
await self.data.update()
|
||||||
self.thermostat = self.data.ecobee.get_thermostat(self.thermostat_index)
|
self.thermostat = self.data.ecobee.get_thermostat(self.thermostat_index)
|
||||||
|
if self.hvac_mode is not HVAC_MODE_OFF:
|
||||||
|
self._last_active_hvac_mode = self.hvac_mode
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
@ -700,3 +703,12 @@ class Thermostat(ClimateDevice):
|
|||||||
vacation_name,
|
vacation_name,
|
||||||
)
|
)
|
||||||
self.data.ecobee.delete_vacation(self.thermostat_index, vacation_name)
|
self.data.ecobee.delete_vacation(self.thermostat_index, vacation_name)
|
||||||
|
|
||||||
|
def turn_on(self):
|
||||||
|
"""Set the thermostat to the last active HVAC mode."""
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Turning on ecobee thermostat %s in %s mode",
|
||||||
|
self.name,
|
||||||
|
self._last_active_hvac_mode,
|
||||||
|
)
|
||||||
|
self.set_hvac_mode(self._last_active_hvac_mode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user