Allow importing homeassistant.core.Config until 2025.11 (#129537)
This commit is contained in:
parent
af144e1b77
commit
1c6ad2fa66
2 changed files with 21 additions and 0 deletions
|
@ -83,6 +83,7 @@ from .exceptions import (
|
||||||
Unauthorized,
|
Unauthorized,
|
||||||
)
|
)
|
||||||
from .helpers.deprecation import (
|
from .helpers.deprecation import (
|
||||||
|
DeferredDeprecatedAlias,
|
||||||
DeprecatedConstantEnum,
|
DeprecatedConstantEnum,
|
||||||
EnumWithDeprecatedMembers,
|
EnumWithDeprecatedMembers,
|
||||||
all_with_deprecated_constants,
|
all_with_deprecated_constants,
|
||||||
|
@ -184,6 +185,19 @@ _DEPRECATED_SOURCE_STORAGE = DeprecatedConstantEnum(ConfigSource.STORAGE, "2025.
|
||||||
_DEPRECATED_SOURCE_YAML = DeprecatedConstantEnum(ConfigSource.YAML, "2025.1")
|
_DEPRECATED_SOURCE_YAML = DeprecatedConstantEnum(ConfigSource.YAML, "2025.1")
|
||||||
|
|
||||||
|
|
||||||
|
def _deprecated_core_config() -> Any:
|
||||||
|
# pylint: disable-next=import-outside-toplevel
|
||||||
|
from . import core_config
|
||||||
|
|
||||||
|
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.
|
# How long to wait until things that run on startup have to finish.
|
||||||
TIMEOUT_EVENT_START = 15
|
TIMEOUT_EVENT_START = 15
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ from homeassistant.core import (
|
||||||
callback,
|
callback,
|
||||||
get_release_channel,
|
get_release_channel,
|
||||||
)
|
)
|
||||||
|
from homeassistant.core_config import Config
|
||||||
from homeassistant.exceptions import (
|
from homeassistant.exceptions import (
|
||||||
HomeAssistantError,
|
HomeAssistantError,
|
||||||
InvalidEntityFormatError,
|
InvalidEntityFormatError,
|
||||||
|
@ -66,6 +67,7 @@ from .common import (
|
||||||
async_capture_events,
|
async_capture_events,
|
||||||
async_mock_service,
|
async_mock_service,
|
||||||
help_test_all,
|
help_test_all,
|
||||||
|
import_and_test_deprecated_alias,
|
||||||
import_and_test_deprecated_constant_enum,
|
import_and_test_deprecated_constant_enum,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -2994,6 +2996,11 @@ def test_deprecated_constants(
|
||||||
import_and_test_deprecated_constant_enum(caplog, ha, enum, "SOURCE_", "2025.1")
|
import_and_test_deprecated_constant_enum(caplog, ha, enum, "SOURCE_", "2025.1")
|
||||||
|
|
||||||
|
|
||||||
|
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:
|
def test_one_time_listener_repr(hass: HomeAssistant) -> None:
|
||||||
"""Test one time listener repr."""
|
"""Test one time listener repr."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue