Skip to content

Commit 7b6df1a

Browse files
authored
Cleanup deprecated typing helpers (home-assistant#158806)
1 parent 2a151dc commit 7b6df1a

File tree

2 files changed

+0
-74
lines changed

2 files changed

+0
-74
lines changed

homeassistant/helpers/typing.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22

33
from collections.abc import Mapping
44
from enum import Enum
5-
from functools import partial
65
from typing import Any, Never
76

87
import voluptuous as vol
98

10-
from .deprecation import (
11-
DeferredDeprecatedAlias,
12-
all_with_deprecated_constants,
13-
check_if_deprecated_constant,
14-
dir_with_deprecated_constants,
15-
)
16-
179
type GPSType = tuple[float, float]
1810
type ConfigType = dict[str, Any]
1911
type DiscoveryInfoType = dict[str, Any]
@@ -35,32 +27,3 @@ class UndefinedType(Enum):
3527

3628

3729
UNDEFINED = UndefinedType._singleton # noqa: SLF001
38-
39-
40-
def _deprecated_typing_helper(attr: str) -> DeferredDeprecatedAlias:
41-
"""Help to make a DeferredDeprecatedAlias."""
42-
43-
def value_fn() -> Any:
44-
import homeassistant.core # noqa: PLC0415
45-
46-
return getattr(homeassistant.core, attr)
47-
48-
return DeferredDeprecatedAlias(value_fn, f"homeassistant.core.{attr}", "2025.5")
49-
50-
51-
# The following types should not used and
52-
# are not present in the core code base.
53-
# They are kept in order not to break custom integrations
54-
# that may rely on them.
55-
# Deprecated as of 2024.5 use types from homeassistant.core instead.
56-
_DEPRECATED_ContextType = _deprecated_typing_helper("Context")
57-
_DEPRECATED_EventType = _deprecated_typing_helper("Event")
58-
_DEPRECATED_HomeAssistantType = _deprecated_typing_helper("HomeAssistant")
59-
_DEPRECATED_ServiceCallType = _deprecated_typing_helper("ServiceCall")
60-
61-
# These can be removed if no deprecated constant are in this module anymore
62-
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
63-
__dir__ = partial(
64-
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
65-
)
66-
__all__ = all_with_deprecated_constants(globals())

tests/helpers/test_typing.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)