From 4fc01631398bacbc559c86387f69d941fef0f7a3 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 13 Jan 2016 21:22:56 -0500 Subject: [PATCH] round min / max values for temperature In order for the polymer thermostat component to have sensible step values the min / max values have to be round numbers. The current code only does that for systems running in degrees C. For those of us in silly land that still function in degrees F, this causes some oddities in the UI. Always round mix / max values to make it good no matter what fundamental units we are in. --- homeassistant/components/thermostat/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index edfa22a7840..7610070b1f0 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -224,12 +224,12 @@ class ThermostatDevice(Entity): @property def min_temp(self): """ Return minimum temperature. """ - return convert(7, TEMP_CELCIUS, self.unit_of_measurement) + return round(convert(7, TEMP_CELCIUS, self.unit_of_measurement)) @property def max_temp(self): """ Return maxmum temperature. """ - return convert(35, TEMP_CELCIUS, self.unit_of_measurement) + return round(convert(35, TEMP_CELCIUS, self.unit_of_measurement)) def _convert(self, temp, round_dec=None): """ Convert temperature from this thermost into user preferred