Don't use room setpoint override in climate.opentherm_gw (#22656)
* Dont use DATA_ROOM_SETPOINT_OVRD in climate.opentherm_gw as it is unreliable with some thermostats. * Show new target temperature immediately until the backend notices a change * Only update target temp on the gateway if the value differs from the current target_temperature.
This commit is contained in:
parent
5651db4b5c
commit
22d93a74a4
1 changed files with 9 additions and 7 deletions
|
@ -39,6 +39,7 @@ class OpenThermGateway(ClimateDevice):
|
||||||
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 = None
|
self._current_temperature = None
|
||||||
|
self._new_target_temperature = None
|
||||||
self._target_temperature = None
|
self._target_temperature = None
|
||||||
self._away_mode_a = None
|
self._away_mode_a = None
|
||||||
self._away_mode_b = None
|
self._away_mode_b = None
|
||||||
|
@ -63,11 +64,10 @@ class OpenThermGateway(ClimateDevice):
|
||||||
else:
|
else:
|
||||||
self._current_operation = STATE_IDLE
|
self._current_operation = STATE_IDLE
|
||||||
self._current_temperature = status.get(self._gw_vars.DATA_ROOM_TEMP)
|
self._current_temperature = status.get(self._gw_vars.DATA_ROOM_TEMP)
|
||||||
|
temp_upd = status.get(self._gw_vars.DATA_ROOM_SETPOINT)
|
||||||
temp = status.get(self._gw_vars.DATA_ROOM_SETPOINT_OVRD)
|
if self._target_temperature != temp_upd:
|
||||||
if temp is None:
|
self._new_target_temperature = None
|
||||||
temp = status.get(self._gw_vars.DATA_ROOM_SETPOINT)
|
self._target_temperature = temp_upd
|
||||||
self._target_temperature = temp
|
|
||||||
|
|
||||||
# GPIO mode 5: 0 == Away
|
# GPIO mode 5: 0 == Away
|
||||||
# GPIO mode 6: 1 == Away
|
# GPIO mode 6: 1 == Away
|
||||||
|
@ -138,7 +138,7 @@ class OpenThermGateway(ClimateDevice):
|
||||||
@property
|
@property
|
||||||
def target_temperature(self):
|
def target_temperature(self):
|
||||||
"""Return the temperature we try to reach."""
|
"""Return the temperature we try to reach."""
|
||||||
return self._target_temperature
|
return self._new_target_temperature or self._target_temperature
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_temperature_step(self):
|
def target_temperature_step(self):
|
||||||
|
@ -154,7 +154,9 @@ class OpenThermGateway(ClimateDevice):
|
||||||
"""Set new target temperature."""
|
"""Set new target temperature."""
|
||||||
if ATTR_TEMPERATURE in kwargs:
|
if ATTR_TEMPERATURE in kwargs:
|
||||||
temp = float(kwargs[ATTR_TEMPERATURE])
|
temp = float(kwargs[ATTR_TEMPERATURE])
|
||||||
self._target_temperature = await self._gateway.set_target_temp(
|
if temp == self.target_temperature:
|
||||||
|
return
|
||||||
|
self._new_target_temperature = await self._gateway.set_target_temp(
|
||||||
temp)
|
temp)
|
||||||
self.async_schedule_update_ha_state()
|
self.async_schedule_update_ha_state()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue