mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Deprecate hass.helpers (#114484)
* Deprecate hass.helpers * Patch * Patch _REPORTED_INTEGRATIONS set in test * Fix test * Update version
This commit is contained in:
committed by
GitHub
parent
f2f24a5d35
commit
d5da0a053b
@@ -1550,6 +1550,20 @@ class Helpers:
|
||||
def __getattr__(self, helper_name: str) -> ModuleWrapper:
|
||||
"""Fetch a helper."""
|
||||
helper = importlib.import_module(f"homeassistant.helpers.{helper_name}")
|
||||
|
||||
# Local import to avoid circular dependencies
|
||||
from .helpers.frame import report # pylint: disable=import-outside-toplevel
|
||||
|
||||
report(
|
||||
(
|
||||
f"accesses hass.helpers.{helper_name}."
|
||||
" This is deprecated and will stop working in Home Assistant 2024.11, it"
|
||||
f" should be updated to import functions used from {helper_name} directly"
|
||||
),
|
||||
error_if_core=False,
|
||||
log_custom_component_only=True,
|
||||
)
|
||||
|
||||
wrapped = ModuleWrapper(self._hass, helper)
|
||||
setattr(self, helper_name, wrapped)
|
||||
return wrapped
|
||||
|
||||
Reference in New Issue
Block a user