Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de9b95903e | |||
| d112273c58 |
@@ -692,6 +692,12 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
|
|||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
under_temp_diff = (
|
||||||
|
(new_target_temp - under.last_sent_temperature) if new_target_temp else 0
|
||||||
|
)
|
||||||
|
if -1 < under_temp_diff < 1:
|
||||||
|
under_temp_diff = 0
|
||||||
|
|
||||||
# Issue 99 - some AC turn hvac_mode=cool and hvac_action=idle when sending a HVACMode_OFF command
|
# Issue 99 - some AC turn hvac_mode=cool and hvac_action=idle when sending a HVACMode_OFF command
|
||||||
# Issue 114 - Remove this because hvac_mode is now managed by local _hvac_mode and use idle action as is
|
# Issue 114 - Remove this because hvac_mode is now managed by local _hvac_mode and use idle action as is
|
||||||
# if self._hvac_mode == HVACMode.OFF and new_hvac_action == HVACAction.IDLE:
|
# if self._hvac_mode == HVACMode.OFF and new_hvac_action == HVACAction.IDLE:
|
||||||
@@ -702,7 +708,7 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
|
|||||||
if (
|
if (
|
||||||
new_hvac_mode == self._hvac_mode
|
new_hvac_mode == self._hvac_mode
|
||||||
and new_hvac_action == old_hvac_action
|
and new_hvac_action == old_hvac_action
|
||||||
and new_target_temp is None
|
and under_temp_diff == 0
|
||||||
and (new_fan_mode is None or new_fan_mode == self._attr_fan_mode)
|
and (new_fan_mode is None or new_fan_mode == self._attr_fan_mode)
|
||||||
):
|
):
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
@@ -834,11 +840,8 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
|
|||||||
under.last_sent_temperature,
|
under.last_sent_temperature,
|
||||||
new_target_temp,
|
new_target_temp,
|
||||||
)
|
)
|
||||||
if (
|
# if the underlying have change its target temperature
|
||||||
# if the underlying have change its target temperature
|
if under_temp_diff != 0:
|
||||||
new_target_temp is not None
|
|
||||||
and new_target_temp != under.last_sent_temperature
|
|
||||||
):
|
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
"%s - Target temp in underlying have change to %s (vs %s)",
|
"%s - Target temp in underlying have change to %s (vs %s)",
|
||||||
self,
|
self,
|
||||||
@@ -849,7 +852,7 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
|
|||||||
changes = True
|
changes = True
|
||||||
else:
|
else:
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"%s - Forget the eventual underlying temperature change because VTherm is regulated",
|
"%s - Forget the eventual underlying temperature change there is no real change",
|
||||||
self,
|
self,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -302,6 +302,23 @@ async def test_bug_101(
|
|||||||
assert entity.target_temperature == 12.75
|
assert entity.target_temperature == 12.75
|
||||||
assert entity.preset_mode is PRESET_NONE
|
assert entity.preset_mode is PRESET_NONE
|
||||||
|
|
||||||
|
# 4. Change the target temp with < 1 value. The value should not be taken
|
||||||
|
# Wait 11 sec
|
||||||
|
event_timestamp = now + timedelta(seconds=11)
|
||||||
|
await send_climate_change_event_with_temperature(
|
||||||
|
entity,
|
||||||
|
HVACMode.HEAT,
|
||||||
|
HVACMode.HEAT,
|
||||||
|
HVACAction.OFF,
|
||||||
|
HVACAction.OFF,
|
||||||
|
event_timestamp,
|
||||||
|
12.5, # 12.75 means 13 in vtherm
|
||||||
|
True,
|
||||||
|
"climate.mock_climate", # the underlying climate entity id
|
||||||
|
)
|
||||||
|
assert entity.target_temperature == 12.75
|
||||||
|
assert entity.preset_mode is PRESET_NONE
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("expected_lingering_timers", [True])
|
@pytest.mark.parametrize("expected_lingering_timers", [True])
|
||||||
async def test_bug_508(
|
async def test_bug_508(
|
||||||
|
|||||||
Reference in New Issue
Block a user