Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa3b87762d | |||
| f4cabbf2c0 | |||
| 24b59e545b | |||
| 5997a26c73 |
@@ -1215,6 +1215,10 @@ class VersatileThermostat(ClimateEntity, RestoreEntity):
|
|||||||
await under.set_hvac_mode(hvac_mode) or need_control_heating
|
await under.set_hvac_mode(hvac_mode) or need_control_heating
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# If AC is on maybe we have to change the temperature in force mode
|
||||||
|
if self._ac_mode:
|
||||||
|
await self._async_set_preset_mode_internal(self._attr_preset_mode, True)
|
||||||
|
|
||||||
if need_control_heating and sub_need_control_heating:
|
if need_control_heating and sub_need_control_heating:
|
||||||
await self._async_control_heating(force=True)
|
await self._async_control_heating(force=True)
|
||||||
|
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
|
|||||||
"""Handle the presence management flow steps"""
|
"""Handle the presence management flow steps"""
|
||||||
_LOGGER.debug("Into ConfigFlow.async_step_presence user_input=%s", user_input)
|
_LOGGER.debug("Into ConfigFlow.async_step_presence user_input=%s", user_input)
|
||||||
|
|
||||||
if self._infos[CONF_AC_MODE]:
|
if self._infos.get(CONF_AC_MODE) == True:
|
||||||
schema = self.STEP_PRESENCE_WITH_AC_DATA_SCHEMA
|
schema = self.STEP_PRESENCE_WITH_AC_DATA_SCHEMA
|
||||||
else:
|
else:
|
||||||
schema = self.STEP_PRESENCE_DATA_SCHEMA
|
schema = self.STEP_PRESENCE_DATA_SCHEMA
|
||||||
@@ -689,7 +689,7 @@ class VersatileThermostatOptionsFlowHandler(
|
|||||||
elif self._infos[CONF_USE_PRESENCE_FEATURE]:
|
elif self._infos[CONF_USE_PRESENCE_FEATURE]:
|
||||||
next_step = self.async_step_presence
|
next_step = self.async_step_presence
|
||||||
|
|
||||||
if self._infos[CONF_AC_MODE]:
|
if self._infos.get(CONF_AC_MODE) == True:
|
||||||
schema = self.STEP_PRESETS_WITH_AC_DATA_SCHEMA
|
schema = self.STEP_PRESETS_WITH_AC_DATA_SCHEMA
|
||||||
else:
|
else:
|
||||||
schema = self.STEP_PRESETS_DATA_SCHEMA
|
schema = self.STEP_PRESETS_DATA_SCHEMA
|
||||||
@@ -752,7 +752,7 @@ class VersatileThermostatOptionsFlowHandler(
|
|||||||
"Into OptionsFlowHandler.async_step_presence user_input=%s", user_input
|
"Into OptionsFlowHandler.async_step_presence user_input=%s", user_input
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._infos[CONF_AC_MODE]:
|
if self._infos.get(CONF_AC_MODE) == True:
|
||||||
schema = self.STEP_PRESENCE_WITH_AC_DATA_SCHEMA
|
schema = self.STEP_PRESENCE_WITH_AC_DATA_SCHEMA
|
||||||
else:
|
else:
|
||||||
schema = self.STEP_PRESENCE_DATA_SCHEMA
|
schema = self.STEP_PRESENCE_DATA_SCHEMA
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from custom_components.versatile_thermostat.const import (
|
|||||||
CONF_THERMOSTAT_CLIMATE,
|
CONF_THERMOSTAT_CLIMATE,
|
||||||
CONF_THERMOSTAT_SWITCH,
|
CONF_THERMOSTAT_SWITCH,
|
||||||
CONF_THERMOSTAT_TYPE,
|
CONF_THERMOSTAT_TYPE,
|
||||||
|
CONF_AC_MODE,
|
||||||
CONF_TEMP_SENSOR,
|
CONF_TEMP_SENSOR,
|
||||||
CONF_EXTERNAL_TEMP_SENSOR,
|
CONF_EXTERNAL_TEMP_SENSOR,
|
||||||
CONF_CYCLE_MIN,
|
CONF_CYCLE_MIN,
|
||||||
@@ -112,6 +113,7 @@ MOCK_TH_OVER_SWITCH_TPI_CONFIG = {
|
|||||||
|
|
||||||
MOCK_TH_OVER_CLIMATE_TYPE_CONFIG = {
|
MOCK_TH_OVER_CLIMATE_TYPE_CONFIG = {
|
||||||
CONF_CLIMATE: "climate.mock_climate",
|
CONF_CLIMATE: "climate.mock_climate",
|
||||||
|
CONF_AC_MODE: False,
|
||||||
}
|
}
|
||||||
|
|
||||||
MOCK_PRESETS_CONFIG = {
|
MOCK_PRESETS_CONFIG = {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ async def test_window_management_time_not_enough(
|
|||||||
await try_window_condition(None)
|
await try_window_condition(None)
|
||||||
assert entity.window_state == STATE_OFF
|
assert entity.window_state == STATE_OFF
|
||||||
|
|
||||||
await entity.remove_thermostat()
|
entity.remove_thermostat()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||||
@@ -234,7 +234,7 @@ async def test_window_management_time_enough(
|
|||||||
assert entity.preset_mode is PRESET_BOOST
|
assert entity.preset_mode is PRESET_BOOST
|
||||||
|
|
||||||
# Clean the entity
|
# Clean the entity
|
||||||
await entity.remove_thermostat()
|
entity.remove_thermostat()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||||
@@ -418,7 +418,7 @@ async def test_window_auto_fast(hass: HomeAssistant, skip_hass_states_is_state):
|
|||||||
assert entity.hvac_mode is HVACMode.HEAT
|
assert entity.hvac_mode is HVACMode.HEAT
|
||||||
|
|
||||||
# Clean the entity
|
# Clean the entity
|
||||||
await entity.remove_thermostat()
|
entity.remove_thermostat()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||||
@@ -561,7 +561,7 @@ async def test_window_auto_auto_stop(hass: HomeAssistant, skip_hass_states_is_st
|
|||||||
assert entity.preset_mode is PRESET_BOOST
|
assert entity.preset_mode is PRESET_BOOST
|
||||||
|
|
||||||
# Clean the entity
|
# Clean the entity
|
||||||
await entity.remove_thermostat()
|
entity.remove_thermostat()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
@pytest.mark.parametrize("expected_lingering_tasks", [True])
|
||||||
@@ -670,4 +670,4 @@ async def test_window_auto_no_on_percent(
|
|||||||
assert entity.hvac_mode is HVACMode.HEAT
|
assert entity.hvac_mode is HVACMode.HEAT
|
||||||
|
|
||||||
# Clean the entity
|
# Clean the entity
|
||||||
await entity.remove_thermostat()
|
entity.remove_thermostat()
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ class UnderlyingSwitch(UnderlyingEntity):
|
|||||||
if hvac_mode == HVACMode.OFF:
|
if hvac_mode == HVACMode.OFF:
|
||||||
if self.is_device_active:
|
if self.is_device_active:
|
||||||
await self.turn_off()
|
await self.turn_off()
|
||||||
await self._cancel_cycle()
|
self._cancel_cycle()
|
||||||
|
|
||||||
if self._hvac_mode != hvac_mode:
|
if self._hvac_mode != hvac_mode:
|
||||||
self._hvac_mode = hvac_mode
|
self._hvac_mode = hvac_mode
|
||||||
@@ -275,7 +275,7 @@ class UnderlyingSwitch(UnderlyingEntity):
|
|||||||
self._on_time_sec,
|
self._on_time_sec,
|
||||||
)
|
)
|
||||||
|
|
||||||
await self._cancel_cycle()
|
self._cancel_cycle()
|
||||||
|
|
||||||
if self._hvac_mode == HVACMode.OFF:
|
if self._hvac_mode == HVACMode.OFF:
|
||||||
_LOGGER.debug("%s - End of cycle (HVAC_MODE_OFF - 2)", self)
|
_LOGGER.debug("%s - End of cycle (HVAC_MODE_OFF - 2)", self)
|
||||||
@@ -327,7 +327,7 @@ class UnderlyingSwitch(UnderlyingEntity):
|
|||||||
self._should_relaunch_control_heating,
|
self._should_relaunch_control_heating,
|
||||||
self._off_time_sec,
|
self._off_time_sec,
|
||||||
)
|
)
|
||||||
await self._cancel_cycle()
|
self._cancel_cycle()
|
||||||
|
|
||||||
if self._hvac_mode == HVACMode.OFF:
|
if self._hvac_mode == HVACMode.OFF:
|
||||||
_LOGGER.debug("%s - End of cycle (HVAC_MODE_OFF - 2)", self)
|
_LOGGER.debug("%s - End of cycle (HVAC_MODE_OFF - 2)", self)
|
||||||
@@ -446,7 +446,7 @@ class UnderlyingClimate(UnderlyingEntity):
|
|||||||
def is_device_active(self):
|
def is_device_active(self):
|
||||||
"""If the toggleable device is currently active."""
|
"""If the toggleable device is currently active."""
|
||||||
if self.is_initialized:
|
if self.is_initialized:
|
||||||
return self._underlying_climate.hvac_action not in [
|
return self._underlying_climate.hvac_mode != HVACMode.OFF and self._underlying_climate.hvac_action not in [
|
||||||
HVACAction.IDLE,
|
HVACAction.IDLE,
|
||||||
HVACAction.OFF,
|
HVACAction.OFF,
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user