Remove deprecated water heater constants (#131805)

This commit is contained in:
Robert Resch 2024-11-28 12:13:03 +01:00 committed by GitHub
parent a67045ee6c
commit 3866176e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 52 deletions

View File

@ -25,12 +25,6 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.temperature import display_temp as show_temp
@ -70,18 +64,6 @@ class WaterHeaterEntityFeature(IntFlag):
ON_OFF = 8
# These SUPPORT_* constants are deprecated as of Home Assistant 2022.5.
# Please use the WaterHeaterEntityFeature enum instead.
_DEPRECATED_SUPPORT_TARGET_TEMPERATURE = DeprecatedConstantEnum(
WaterHeaterEntityFeature.TARGET_TEMPERATURE, "2025.1"
)
_DEPRECATED_SUPPORT_OPERATION_MODE = DeprecatedConstantEnum(
WaterHeaterEntityFeature.OPERATION_MODE, "2025.1"
)
_DEPRECATED_SUPPORT_AWAY_MODE = DeprecatedConstantEnum(
WaterHeaterEntityFeature.AWAY_MODE, "2025.1"
)
ATTR_MAX_TEMP = "max_temp"
ATTR_MIN_TEMP = "min_temp"
ATTR_AWAY_MODE = "away_mode"
@ -437,11 +419,3 @@ async def async_service_temperature_set(
kwargs[value] = temp
await entity.async_set_temperature(**kwargs)
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())

View File

@ -8,7 +8,6 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
import voluptuous as vol
from homeassistant.components import water_heater
from homeassistant.components.water_heater import (
ATTR_OPERATION_LIST,
ATTR_OPERATION_MODE,
@ -30,8 +29,6 @@ from tests.common import (
MockModule,
MockPlatform,
async_mock_service,
help_test_all,
import_and_test_deprecated_constant_enum,
mock_integration,
mock_platform,
)
@ -211,29 +208,6 @@ async def test_operation_mode_validation(
water_heater_entity.set_operation_mode.assert_has_calls([mock.call("eco")])
def test_all() -> None:
"""Test module.__all__ is correctly set."""
help_test_all(water_heater)
@pytest.mark.parametrize(
("enum"),
[
WaterHeaterEntityFeature.TARGET_TEMPERATURE,
WaterHeaterEntityFeature.OPERATION_MODE,
WaterHeaterEntityFeature.AWAY_MODE,
],
)
def test_deprecated_constants(
caplog: pytest.LogCaptureFixture,
enum: WaterHeaterEntityFeature,
) -> None:
"""Test deprecated constants."""
import_and_test_deprecated_constant_enum(
caplog, water_heater, enum, "SUPPORT_", "2025.1"
)
def test_deprecated_supported_features_ints(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None: