Bug fixes and state adjustment for initial thermostat range support

This commit is contained in:
zyell 2015-09-10 15:42:34 -07:00
parent 2d54fdd979
commit 21812ba717
2 changed files with 4 additions and 7 deletions

View File

@ -114,7 +114,7 @@ class ThermostatDevice(Entity):
@property @property
def state(self): def state(self):
""" Returns the current state. """ """ Returns the current state. """
return self.operation return self.target_temperature
@property @property
def device_state_attributes(self): def device_state_attributes(self):
@ -147,10 +147,7 @@ class ThermostatDevice(Entity):
ATTR_TEMPERATURE_HIGH: round(convert(self.target_temperature_high, ATTR_TEMPERATURE_HIGH: round(convert(self.target_temperature_high,
thermostat_unit, thermostat_unit,
user_unit), 0), user_unit), 0),
ATTR_OPERATION: round(convert(self.operation, ATTR_OPERATION: self.operation
thermostat_unit,
user_unit), 0)
} }
is_away = self.is_away_mode_on is_away = self.is_away_mode_on

View File

@ -123,14 +123,14 @@ class NestThermostat(ThermostatDevice):
def target_temperature_low(self): def target_temperature_low(self):
""" Returns the lower bound temperature we try to reach. """ """ Returns the lower bound temperature we try to reach. """
if self.device.mode == 'range': if self.device.mode == 'range':
return self.device.target["low"] return round(self.device.target[0], 1)
return round(self.target_temperature, 1) return round(self.target_temperature, 1)
@property @property
def target_temperature_high(self): def target_temperature_high(self):
""" Returns the upper bound temperature we try to reach. """ """ Returns the upper bound temperature we try to reach. """
if self.device.mode == 'range': if self.device.mode == 'range':
return self.device.target["high"] return round(self.device.target[1], 1)
return round(self.target_temperature, 1) return round(self.target_temperature, 1)
@property @property