mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Include deprecated constants in wildcard imports (#107114)
This commit is contained in:
@@ -83,6 +83,7 @@ from .exceptions import (
|
||||
)
|
||||
from .helpers.deprecation import (
|
||||
DeprecatedConstantEnum,
|
||||
all_with_deprecated_constants,
|
||||
check_if_deprecated_constant,
|
||||
dir_with_deprecated_constants,
|
||||
)
|
||||
@@ -159,11 +160,6 @@ _DEPRECATED_SOURCE_STORAGE = DeprecatedConstantEnum(ConfigSource.STORAGE, "2025.
|
||||
_DEPRECATED_SOURCE_YAML = DeprecatedConstantEnum(ConfigSource.YAML, "2025.1")
|
||||
|
||||
|
||||
# Both 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=globals())
|
||||
|
||||
|
||||
# How long to wait until things that run on startup have to finish.
|
||||
TIMEOUT_EVENT_START = 15
|
||||
|
||||
@@ -2545,3 +2541,11 @@ class Config:
|
||||
if self._original_unit_system:
|
||||
data["unit_system"] = self._original_unit_system
|
||||
return await super().async_save(data)
|
||||
|
||||
|
||||
# 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())
|
||||
|
||||
Reference in New Issue
Block a user