Update Ecobee state after making changes to climate (#3436)
* Update Ecobee state after making changes to climate Without this, climate and sensor state will take up to 3 minutes (the MIN_TIME_BETWEEN_UPDATES on its update throttle) to update in the interface, which makes it more difficult to do automation around the state. * Use a boolean instance variable that update can check, rather than always calling updatepull/2930/merge
parent
11c07440fe
commit
b34101b277
|
@ -86,10 +86,16 @@ class Thermostat(ClimateDevice):
|
||||||
self.hold_temp = hold_temp
|
self.hold_temp = hold_temp
|
||||||
self._operation_list = ['auto', 'auxHeatOnly', 'cool',
|
self._operation_list = ['auto', 'auxHeatOnly', 'cool',
|
||||||
'heat', 'off']
|
'heat', 'off']
|
||||||
|
self.update_without_throttle = False
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest state from the thermostat."""
|
"""Get the latest state from the thermostat."""
|
||||||
self.data.update()
|
if self.update_without_throttle:
|
||||||
|
self.data.update(no_throttle=True)
|
||||||
|
self.update_without_throttle = False
|
||||||
|
else:
|
||||||
|
self.data.update()
|
||||||
|
|
||||||
self.thermostat = self.data.ecobee.get_thermostat(
|
self.thermostat = self.data.ecobee.get_thermostat(
|
||||||
self.thermostat_index)
|
self.thermostat_index)
|
||||||
|
|
||||||
|
@ -211,10 +217,12 @@ class Thermostat(ClimateDevice):
|
||||||
"away", "indefinite")
|
"away", "indefinite")
|
||||||
else:
|
else:
|
||||||
self.data.ecobee.set_climate_hold(self.thermostat_index, "away")
|
self.data.ecobee.set_climate_hold(self.thermostat_index, "away")
|
||||||
|
self.update_without_throttle = True
|
||||||
|
|
||||||
def turn_away_mode_off(self):
|
def turn_away_mode_off(self):
|
||||||
"""Turn away off."""
|
"""Turn away off."""
|
||||||
self.data.ecobee.resume_program(self.thermostat_index)
|
self.data.ecobee.resume_program(self.thermostat_index)
|
||||||
|
self.update_without_throttle = True
|
||||||
|
|
||||||
def set_temperature(self, **kwargs):
|
def set_temperature(self, **kwargs):
|
||||||
"""Set new target temperature."""
|
"""Set new target temperature."""
|
||||||
|
@ -241,15 +249,18 @@ class Thermostat(ClimateDevice):
|
||||||
"high=%s, is=%s", low_temp, isinstance(
|
"high=%s, is=%s", low_temp, isinstance(
|
||||||
low_temp, (int, float)), high_temp,
|
low_temp, (int, float)), high_temp,
|
||||||
isinstance(high_temp, (int, float)))
|
isinstance(high_temp, (int, float)))
|
||||||
|
self.update_without_throttle = True
|
||||||
|
|
||||||
def set_operation_mode(self, operation_mode):
|
def set_operation_mode(self, operation_mode):
|
||||||
"""Set HVAC mode (auto, auxHeatOnly, cool, heat, off)."""
|
"""Set HVAC mode (auto, auxHeatOnly, cool, heat, off)."""
|
||||||
self.data.ecobee.set_hvac_mode(self.thermostat_index, operation_mode)
|
self.data.ecobee.set_hvac_mode(self.thermostat_index, operation_mode)
|
||||||
|
self.update_without_throttle = True
|
||||||
|
|
||||||
def set_fan_min_on_time(self, fan_min_on_time):
|
def set_fan_min_on_time(self, fan_min_on_time):
|
||||||
"""Set the minimum fan on time."""
|
"""Set the minimum fan on time."""
|
||||||
self.data.ecobee.set_fan_min_on_time(self.thermostat_index,
|
self.data.ecobee.set_fan_min_on_time(self.thermostat_index,
|
||||||
fan_min_on_time)
|
fan_min_on_time)
|
||||||
|
self.update_without_throttle = True
|
||||||
|
|
||||||
# Home and Sleep mode aren't used in UI yet:
|
# Home and Sleep mode aren't used in UI yet:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue