From 4423572682a24f8de7a832ab6ae46590594b7e1e Mon Sep 17 00:00:00 2001 From: mvn23 Date: Sat, 16 Mar 2019 16:34:31 +0100 Subject: [PATCH] Fix TypeError in current_temperature if no temperature is known. (#22112) Don't set opentherm_gw climate temperatures to 0 on init. --- homeassistant/components/opentherm_gw/climate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/opentherm_gw/climate.py b/homeassistant/components/opentherm_gw/climate.py index 584be4c0c64834..1a7c031638f79f 100644 --- a/homeassistant/components/opentherm_gw/climate.py +++ b/homeassistant/components/opentherm_gw/climate.py @@ -37,8 +37,8 @@ def __init__(self, hass, config): self.floor_temp = config.get(CONF_FLOOR_TEMP) self.temp_precision = config.get(CONF_PRECISION) self._current_operation = STATE_IDLE - self._current_temperature = 0.0 - self._target_temperature = 0.0 + self._current_temperature = None + self._target_temperature = None self._away_mode_a = None self._away_mode_b = None self._away_state_a = False @@ -124,6 +124,8 @@ def current_operation(self): @property def current_temperature(self): """Return the current temperature.""" + if self._current_temperature is None: + return if self.floor_temp is True: if self.temp_precision == PRECISION_HALVES: return int(2 * self._current_temperature) / 2