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

View File

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