From f53812f2616b4ac3a11350b198dc8f3f812d625d Mon Sep 17 00:00:00 2001 From: mvn23 Date: Tue, 26 Nov 2019 00:08:18 +0100 Subject: [PATCH] Fix opentherm_gw config flow migration (#28474) * Fix opentherm_gw migration to config flow. * Address feedback --- homeassistant/components/opentherm_gw/climate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/opentherm_gw/climate.py b/homeassistant/components/opentherm_gw/climate.py index 44f143d64da..28a0ae98270 100644 --- a/homeassistant/components/opentherm_gw/climate.py +++ b/homeassistant/components/opentherm_gw/climate.py @@ -31,6 +31,9 @@ from .const import CONF_FLOOR_TEMP, CONF_PRECISION, DATA_GATEWAYS, DATA_OPENTHER _LOGGER = logging.getLogger(__name__) +DEFAULT_FLOOR_TEMP = False +DEFAULT_PRECISION = None + SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE @@ -54,8 +57,8 @@ class OpenThermClimate(ClimateDevice): """Initialize the device.""" self._gateway = gw_dev self.friendly_name = gw_dev.name - self.floor_temp = options[CONF_FLOOR_TEMP] - self.temp_precision = options.get(CONF_PRECISION) + self.floor_temp = options.get(CONF_FLOOR_TEMP, DEFAULT_FLOOR_TEMP) + self.temp_precision = options.get(CONF_PRECISION, DEFAULT_PRECISION) self._current_operation = None self._current_temperature = None self._hvac_mode = HVAC_MODE_HEAT @@ -70,7 +73,7 @@ class OpenThermClimate(ClimateDevice): def update_options(self, entry): """Update climate entity options.""" self.floor_temp = entry.options[CONF_FLOOR_TEMP] - self.temp_precision = entry.options.get(CONF_PRECISION) + self.temp_precision = entry.options[CONF_PRECISION] self.async_schedule_update_ha_state() async def async_added_to_hass(self):