From 1e09bddb1dcc422ea47c35f7f2e3ca38a1258013 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 13 Dec 2025 09:29:15 +0100 Subject: [PATCH] Cleanup deprecated alias in core (#158799) --- homeassistant/core.py | 28 ++-------------------------- tests/test_core.py | 18 +----------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/homeassistant/core.py b/homeassistant/core.py index 584616277d4..917d86d752c 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -84,12 +84,6 @@ from .exceptions import ( ServiceValidationError, Unauthorized, ) -from .helpers.deprecation import ( - DeferredDeprecatedAlias, - all_with_deprecated_constants, - check_if_deprecated_constant, - dir_with_deprecated_constants, -) from .helpers.json import json_bytes, json_fragment from .helpers.typing import VolSchemaType from .util import dt as dt_util @@ -161,18 +155,6 @@ class EventStateReportedData(EventStateEventData): old_last_reported: datetime.datetime -def _deprecated_core_config() -> Any: - from . import core_config # noqa: PLC0415 - - return core_config.Config - - -# The Config class was moved to core_config in Home Assistant 2024.11 -_DEPRECATED_Config = DeferredDeprecatedAlias( - _deprecated_core_config, "homeassistant.core_config.Config", "2025.11" -) - - # How long to wait until things that run on startup have to finish. TIMEOUT_EVENT_START = 15 @@ -280,6 +262,8 @@ def async_get_hass_or_none() -> HomeAssistant | None: class ReleaseChannel(enum.StrEnum): + """Release channel.""" + BETA = "beta" DEV = "dev" NIGHTLY = "nightly" @@ -2883,11 +2867,3 @@ class ServiceRegistry: if TYPE_CHECKING: target = cast(Callable[..., ServiceResponse], target) return await self._hass.async_add_executor_job(target, service_call) - - -# These can be removed if no deprecated constant are in this module anymore -__getattr__ = functools.partial(check_if_deprecated_constant, module_globals=globals()) -__dir__ = functools.partial( - dir_with_deprecated_constants, module_globals_keys=[*globals().keys()] -) -__all__ = all_with_deprecated_constants(globals()) diff --git a/tests/test_core.py b/tests/test_core.py index 0daaafe74cf..19ab0b8cace 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -49,7 +49,6 @@ from homeassistant.core import ( callback, get_release_channel, ) -from homeassistant.core_config import Config from homeassistant.exceptions import ( HomeAssistantError, InvalidEntityFormatError, @@ -64,12 +63,7 @@ from homeassistant.util import dt as dt_util from homeassistant.util.async_ import create_eager_task from homeassistant.util.read_only_dict import ReadOnlyDict -from .common import ( - async_capture_events, - async_mock_service, - help_test_all, - import_and_test_deprecated_alias, -) +from .common import async_capture_events, async_mock_service PST = dt_util.get_time_zone("America/Los_Angeles") @@ -3019,16 +3013,6 @@ async def test_cancel_shutdown_job(hass: HomeAssistant) -> None: assert not evt.is_set() -def test_all() -> None: - """Test module.__all__ is correctly set.""" - help_test_all(ha) - - -def test_deprecated_config(caplog: pytest.LogCaptureFixture) -> None: - """Test deprecated Config class.""" - import_and_test_deprecated_alias(caplog, ha, "Config", Config, "2025.11") - - def test_one_time_listener_repr(hass: HomeAssistant) -> None: """Test one time listener repr."""