Bugfix ecobee: inverted high and low temps and enforce int to temps (#3325)

* inverted high and low temps

* Looks like somethings are mixed up

* Added debugentires

* Added debugentires 2

* Enforce int on temperatures
This commit is contained in:
John Arild Berentsen 2016-09-12 17:40:46 +02:00 committed by Paulus Schoutsen
parent 07148fc580
commit c6b6ab1b79

View File

@ -116,9 +116,6 @@ class Thermostat(ClimateDevice):
return self.target_temperature_low return self.target_temperature_low
elif self.operation_mode == 'cool': elif self.operation_mode == 'cool':
return self.target_temperature_high return self.target_temperature_high
else:
return (self.target_temperature_low +
self.target_temperature_high) / 2
@property @property
def target_temperature_low(self): def target_temperature_low(self):
@ -223,19 +220,27 @@ class Thermostat(ClimateDevice):
"""Set new target temperature.""" """Set new target temperature."""
if kwargs.get(ATTR_TEMPERATURE) is not None: if kwargs.get(ATTR_TEMPERATURE) is not None:
temperature = kwargs.get(ATTR_TEMPERATURE) temperature = kwargs.get(ATTR_TEMPERATURE)
low_temp = temperature - 1 low_temp = int(temperature)
high_temp = temperature + 1 high_temp = int(temperature)
if kwargs.get(ATTR_TARGET_TEMP_LOW) is not None and \ if kwargs.get(ATTR_TARGET_TEMP_LOW) is not None and \
kwargs.get(ATTR_TARGET_TEMP_HIGH) is not None: kwargs.get(ATTR_TARGET_TEMP_HIGH) is not None:
low_temp = kwargs.get(ATTR_TARGET_TEMP_LOW) high_temp = int(kwargs.get(ATTR_TARGET_TEMP_LOW))
high_temp = kwargs.get(ATTR_TARGET_TEMP_HIGH) low_temp = int(kwargs.get(ATTR_TARGET_TEMP_HIGH))
if self.hold_temp: if self.hold_temp:
self.data.ecobee.set_hold_temp(self.thermostat_index, low_temp, self.data.ecobee.set_hold_temp(self.thermostat_index, low_temp,
high_temp, "indefinite") high_temp, "indefinite")
_LOGGER.debug("Setting ecobee hold_temp to: low=%s, is=%s, "
"high=%s, is=%s", low_temp, isinstance(
low_temp, (int, float)), high_temp,
isinstance(high_temp, (int, float)))
else: else:
self.data.ecobee.set_hold_temp(self.thermostat_index, low_temp, self.data.ecobee.set_hold_temp(self.thermostat_index, low_temp,
high_temp) high_temp)
_LOGGER.debug("Setting ecobee temp to: low=%s, is=%s, "
"high=%s, is=%s", low_temp, isinstance(
low_temp, (int, float)), high_temp,
isinstance(high_temp, (int, float)))
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)."""