Fix TypeError in current_temperature if no temperature is known. (#22112)
Don't set opentherm_gw climate temperatures to 0 on init.
This commit is contained in:
1 parent
42e75dc45c
commit
ddefb74215
1 file changed
+4
-2
@@ -37,8 +37,8 @@ class OpenThermGateway(ClimateDevice):
|
|||||||
self.floor_temp = config.get(CONF_FLOOR_TEMP)
|
self.floor_temp = config.get(CONF_FLOOR_TEMP)
|
||||||
self.temp_precision = config.get(CONF_PRECISION)
|
self.temp_precision = config.get(CONF_PRECISION)
|
||||||
self._current_operation = STATE_IDLE
|
self._current_operation = STATE_IDLE
|
||||||
self._current_temperature = 0.0
|
self._current_temperature = None
|
||||||
self._target_temperature = 0.0
|
self._target_temperature = None
|
||||||
self._away_mode_a = None
|
self._away_mode_a = None
|
||||||
self._away_mode_b = None
|
self._away_mode_b = None
|
||||||
self._away_state_a = False
|
self._away_state_a = False
|
||||||
@@ -124,6 +124,8 @@ class OpenThermGateway(ClimateDevice):
|
|||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
"""Return the current temperature."""
|
"""Return the current temperature."""
|
||||||
|
if self._current_temperature is None:
|
||||||
|
return
|
||||||
if self.floor_temp is True:
|
if self.floor_temp is True:
|
||||||
if self.temp_precision == PRECISION_HALVES:
|
if self.temp_precision == PRECISION_HALVES:
|
||||||
return int(2 * self._current_temperature) / 2
|
return int(2 * self._current_temperature) / 2
|
||||||
|
|||||||
Reference in new issue
Block a user