From d921073e77e7a719af753f1404c20a36c77f6ead Mon Sep 17 00:00:00 2001 From: juggie Date: Mon, 17 Oct 2016 23:06:03 -0400 Subject: [PATCH] Ecobee - Celsius (#3906) * #3899 - Ecobee tempoeratures * #3899 Remove unused import * #3899 Implement min/max_temp in ecobee.py as these temperatures have to be in F for ecobee api. * #3899 Stale print * #3899 Use min/max_temp from base class * #3899 Removed unused import (again) so tests pass since changing to use super class * #3899 Fix long lines * #3899 Install tox locally... make it happy, commit * #3899 Remove overridden min/max_temp and instead update __init__:min/max_temp to convert to self.temperature_unit (of the thermostat) as opposed to self.unit_of_measurement (of the system), which is wrong * Remove unused import from ecobee --- homeassistant/components/climate/__init__.py | 4 ++-- homeassistant/components/climate/ecobee.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index 7652c5db214..714581ba331 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -545,12 +545,12 @@ class ClimateDevice(Entity): @property def min_temp(self): """Return the minimum temperature.""" - return convert_temperature(7, TEMP_CELSIUS, self.unit_of_measurement) + return convert_temperature(7, TEMP_CELSIUS, self.temperature_unit) @property def max_temp(self): """Return the maximum temperature.""" - return convert_temperature(35, TEMP_CELSIUS, self.unit_of_measurement) + return convert_temperature(35, TEMP_CELSIUS, self.temperature_unit) @property def min_humidity(self): diff --git a/homeassistant/components/climate/ecobee.py b/homeassistant/components/climate/ecobee.py index 4b414935136..1ed826e55dc 100644 --- a/homeassistant/components/climate/ecobee.py +++ b/homeassistant/components/climate/ecobee.py @@ -14,7 +14,7 @@ from homeassistant.components.climate import ( DOMAIN, STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice, ATTR_TARGET_TEMP_LOW, ATTR_TARGET_TEMP_HIGH) from homeassistant.const import ( - ATTR_ENTITY_ID, STATE_OFF, STATE_ON, TEMP_FAHRENHEIT, TEMP_CELSIUS) + ATTR_ENTITY_ID, STATE_OFF, STATE_ON, TEMP_FAHRENHEIT) from homeassistant.config import load_yaml_config_file import homeassistant.helpers.config_validation as cv @@ -107,10 +107,7 @@ class Thermostat(ClimateDevice): @property def temperature_unit(self): """Return the unit of measurement.""" - if self.thermostat['settings']['useCelsius']: - return TEMP_CELSIUS - else: - return TEMP_FAHRENHEIT + return TEMP_FAHRENHEIT @property def current_temperature(self):