Remove deprecated redundant dry and fan modes from zwave_js climates (#108124)

Remove deprecated redundant dry and fan modes from zwave_js climates
This commit is contained in:
Jan Bouwhuis 2024-01-17 15:55:46 +01:00 committed by GitHub
parent 91815ed5f9
commit c47fb5d161
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 137 deletions

View file

@ -18,7 +18,6 @@ from homeassistant.components.climate import (
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
ATTR_PRESET_MODE,
ATTR_PRESET_MODES,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
DOMAIN as CLIMATE_DOMAIN,
@ -41,10 +40,8 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import issue_registry as ir
from .common import (
CLIMATE_AIDOO_HVAC_UNIT_ENTITY,
CLIMATE_DANFOSS_LC13_ENTITY,
CLIMATE_EUROTRONICS_SPIRIT_Z_ENTITY,
CLIMATE_FLOOR_THERMOSTAT_ENTITY,
@ -769,98 +766,3 @@ async def test_thermostat_unknown_values(
state = hass.states.get(CLIMATE_RADIO_THERMOSTAT_ENTITY)
assert ATTR_HVAC_ACTION not in state.attributes
async def test_thermostat_dry_and_fan_both_hvac_mode_and_preset(
hass: HomeAssistant,
client,
climate_airzone_aidoo_control_hvac_unit,
integration,
) -> None:
"""Test that dry and fan modes are both available as hvac mode and preset."""
state = hass.states.get(CLIMATE_AIDOO_HVAC_UNIT_ENTITY)
assert state
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.OFF,
HVACMode.HEAT,
HVACMode.COOL,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.HEAT_COOL,
]
assert state.attributes[ATTR_PRESET_MODES] == [
PRESET_NONE,
"Fan",
"Dry",
]
async def test_thermostat_raise_repair_issue_and_warning_when_setting_dry_preset(
hass: HomeAssistant,
client,
climate_airzone_aidoo_control_hvac_unit,
integration,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test raise of repair issue and warning when setting Dry preset."""
client.async_send_command.return_value = {"result": {"status": 1}}
state = hass.states.get(CLIMATE_AIDOO_HVAC_UNIT_ENTITY)
assert state
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_PRESET_MODE,
{
ATTR_ENTITY_ID: CLIMATE_AIDOO_HVAC_UNIT_ENTITY,
ATTR_PRESET_MODE: "Dry",
},
blocking=True,
)
issue_id = f"dry_fan_presets_deprecation_{CLIMATE_AIDOO_HVAC_UNIT_ENTITY}"
issue_registry = ir.async_get(hass)
assert issue_registry.async_get_issue(
domain=DOMAIN,
issue_id=issue_id,
)
assert (
"Dry and Fan preset modes are deprecated and will be removed in Home Assistant 2024.2. Please use the corresponding Dry and Fan HVAC modes instead"
in caplog.text
)
async def test_thermostat_raise_repair_issue_and_warning_when_setting_fan_preset(
hass: HomeAssistant,
client,
climate_airzone_aidoo_control_hvac_unit,
integration,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test raise of repair issue and warning when setting Fan preset."""
client.async_send_command.return_value = {"result": {"status": 1}}
state = hass.states.get(CLIMATE_AIDOO_HVAC_UNIT_ENTITY)
assert state
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_PRESET_MODE,
{
ATTR_ENTITY_ID: CLIMATE_AIDOO_HVAC_UNIT_ENTITY,
ATTR_PRESET_MODE: "Fan",
},
blocking=True,
)
issue_id = f"dry_fan_presets_deprecation_{CLIMATE_AIDOO_HVAC_UNIT_ENTITY}"
issue_registry = ir.async_get(hass)
assert issue_registry.async_get_issue(
domain=DOMAIN,
issue_id=issue_id,
)
assert (
"Dry and Fan preset modes are deprecated and will be removed in Home Assistant 2024.2. Please use the corresponding Dry and Fan HVAC modes instead"
in caplog.text
)