Deprecate deprecated device_registry helper constants (#106227)
This commit is contained in:
parent
23fa86cc23
commit
e18d2b8873
2 changed files with 31 additions and 4 deletions
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||
from collections import UserDict
|
||||
from collections.abc import Coroutine, ValuesView
|
||||
from enum import StrEnum
|
||||
from functools import partial
|
||||
import logging
|
||||
import time
|
||||
from typing import TYPE_CHECKING, Any, Literal, TypedDict, TypeVar, cast
|
||||
|
@ -21,6 +22,11 @@ import homeassistant.util.uuid as uuid_util
|
|||
|
||||
from . import storage
|
||||
from .debounce import Debouncer
|
||||
from .deprecation import (
|
||||
DeprecatedConstantEnum,
|
||||
check_if_deprecated_constant,
|
||||
dir_with_deprecated_constants,
|
||||
)
|
||||
from .frame import report
|
||||
from .json import JSON_DUMP, find_paths_unserializable_data
|
||||
from .typing import UNDEFINED, UndefinedType
|
||||
|
@ -61,9 +67,17 @@ class DeviceEntryDisabler(StrEnum):
|
|||
|
||||
|
||||
# DISABLED_* are deprecated, to be removed in 2022.3
|
||||
DISABLED_CONFIG_ENTRY = DeviceEntryDisabler.CONFIG_ENTRY.value
|
||||
DISABLED_INTEGRATION = DeviceEntryDisabler.INTEGRATION.value
|
||||
DISABLED_USER = DeviceEntryDisabler.USER.value
|
||||
_DEPRECATED_DISABLED_CONFIG_ENTRY = DeprecatedConstantEnum(
|
||||
DeviceEntryDisabler.CONFIG_ENTRY, "2025.1"
|
||||
)
|
||||
_DEPRECATED_DISABLED_INTEGRATION = DeprecatedConstantEnum(
|
||||
DeviceEntryDisabler.INTEGRATION, "2025.1"
|
||||
)
|
||||
_DEPRECATED_DISABLED_USER = DeprecatedConstantEnum(DeviceEntryDisabler.USER, "2025.1")
|
||||
|
||||
# Both can be removed if no deprecated constant are in this module anymore
|
||||
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
|
||||
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())
|
||||
|
||||
|
||||
class DeviceInfo(TypedDict, total=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue