From f3b702db5abc8c4ebb52a32f88f59d5f613a3cb5 Mon Sep 17 00:00:00 2001 From: Adam Michaleski <38081677+prairieapps@users.noreply.github.com> Date: Tue, 14 Apr 2020 16:10:44 -0500 Subject: [PATCH] Fix for schluter unit system bug (#34230) --- homeassistant/components/schluter/climate.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/schluter/climate.py b/homeassistant/components/schluter/climate.py index 99dc5b0d495..d91020c7c2b 100644 --- a/homeassistant/components/schluter/climate.py +++ b/homeassistant/components/schluter/climate.py @@ -7,6 +7,7 @@ import voluptuous as vol from homeassistant.components.climate import ( PLATFORM_SCHEMA, SCAN_INTERVAL, + TEMP_CELSIUS, ClimateDevice, ) from homeassistant.components.climate.const import ( @@ -32,7 +33,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= return session_id = hass.data[DOMAIN][DATA_SCHLUTER_SESSION] api = hass.data[DOMAIN][DATA_SCHLUTER_API] - temp_unit = hass.config.units.temperature_unit async def async_update_data(): try: @@ -58,7 +58,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= await coordinator.async_refresh() async_add_entities( - SchluterThermostat(coordinator, serial_number, temp_unit, api, session_id) + SchluterThermostat(coordinator, serial_number, api, session_id) for serial_number, thermostat in coordinator.data.items() ) @@ -66,9 +66,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= class SchluterThermostat(ClimateDevice): """Representation of a Schluter thermostat.""" - def __init__(self, coordinator, serial_number, temp_unit, api, session_id): + def __init__(self, coordinator, serial_number, api, session_id): """Initialize the thermostat.""" - self._unit = temp_unit self._coordinator = coordinator self._serial_number = serial_number self._api = api @@ -102,8 +101,8 @@ class SchluterThermostat(ClimateDevice): @property def temperature_unit(self): - """Return the unit of measurement.""" - return self._unit + """Schluter API always uses celsius.""" + return TEMP_CELSIUS @property def current_temperature(self):