Skip to content
Snippets Groups Projects
Unverified Commit c5f68bcc authored by Robert Resch's avatar Robert Resch Committed by GitHub
Browse files

Remove deprecated remote constants (#131809)

parent 3866176e
No related branches found
No related tags found
No related merge requests found
...@@ -22,12 +22,6 @@ from homeassistant.const import ( ...@@ -22,12 +22,6 @@ from homeassistant.const import (
) )
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv 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 ToggleEntity, ToggleEntityDescription from homeassistant.helpers.entity import ToggleEntity, ToggleEntityDescription
from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
...@@ -74,19 +68,6 @@ class RemoteEntityFeature(IntFlag): ...@@ -74,19 +68,6 @@ class RemoteEntityFeature(IntFlag):
ACTIVITY = 4 ACTIVITY = 4
# These SUPPORT_* constants are deprecated as of Home Assistant 2022.5.
# Please use the RemoteEntityFeature enum instead.
_DEPRECATED_SUPPORT_LEARN_COMMAND = DeprecatedConstantEnum(
RemoteEntityFeature.LEARN_COMMAND, "2025.1"
)
_DEPRECATED_SUPPORT_DELETE_COMMAND = DeprecatedConstantEnum(
RemoteEntityFeature.DELETE_COMMAND, "2025.1"
)
_DEPRECATED_SUPPORT_ACTIVITY = DeprecatedConstantEnum(
RemoteEntityFeature.ACTIVITY, "2025.1"
)
REMOTE_SERVICE_ACTIVITY_SCHEMA = cv.make_entity_service_schema( REMOTE_SERVICE_ACTIVITY_SCHEMA = cv.make_entity_service_schema(
{vol.Optional(ATTR_ACTIVITY): cv.string} {vol.Optional(ATTR_ACTIVITY): cv.string}
) )
...@@ -251,11 +232,3 @@ class RemoteEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_) ...@@ -251,11 +232,3 @@ class RemoteEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_)
await self.hass.async_add_executor_job( await self.hass.async_add_executor_job(
ft.partial(self.delete_command, **kwargs) ft.partial(self.delete_command, **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())
...@@ -23,11 +23,7 @@ from homeassistant.const import ( ...@@ -23,11 +23,7 @@ from homeassistant.const import (
) )
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from tests.common import ( from tests.common import async_mock_service
async_mock_service,
help_test_all,
import_and_test_deprecated_constant_enum,
)
TEST_PLATFORM = {DOMAIN: {CONF_PLATFORM: "test"}} TEST_PLATFORM = {DOMAIN: {CONF_PLATFORM: "test"}}
SERVICE_SEND_COMMAND = "send_command" SERVICE_SEND_COMMAND = "send_command"
...@@ -148,20 +144,6 @@ async def test_delete_command(hass: HomeAssistant) -> None: ...@@ -148,20 +144,6 @@ async def test_delete_command(hass: HomeAssistant) -> None:
assert call.data[ATTR_ENTITY_ID] == ENTITY_ID assert call.data[ATTR_ENTITY_ID] == ENTITY_ID
def test_all() -> None:
"""Test module.__all__ is correctly set."""
help_test_all(remote)
@pytest.mark.parametrize(("enum"), list(remote.RemoteEntityFeature))
def test_deprecated_constants(
caplog: pytest.LogCaptureFixture,
enum: remote.RemoteEntityFeature,
) -> None:
"""Test deprecated constants."""
import_and_test_deprecated_constant_enum(caplog, remote, enum, "SUPPORT_", "2025.1")
def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None: def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None:
"""Test deprecated supported features ints.""" """Test deprecated supported features ints."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment