Skip to content

Commit

Permalink
Fix TypeError in current_temperature if no temperature is known. (#22112
Browse files Browse the repository at this point in the history
)

Don't set opentherm_gw climate temperatures to 0 on init.
  • Loading branch information
mvn23 authored and Danielhiversen committed Mar 16, 2019
1 parent c90f0d5 commit 4423572
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions homeassistant/components/opentherm_gw/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4423572

Please sign in to comment.