mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Warn on use of deprecated async_get_registry (#72088)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
349347cade
commit
99941b1c32
@ -12,6 +12,7 @@ from homeassistant.loader import bind_hass
|
|||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
from . import device_registry as dr, entity_registry as er
|
from . import device_registry as dr, entity_registry as er
|
||||||
|
from .frame import report
|
||||||
from .storage import Store
|
from .storage import Store
|
||||||
from .typing import UNDEFINED, UndefinedType
|
from .typing import UNDEFINED, UndefinedType
|
||||||
|
|
||||||
@ -226,6 +227,9 @@ async def async_get_registry(hass: HomeAssistant) -> AreaRegistry:
|
|||||||
|
|
||||||
This is deprecated and will be removed in the future. Use async_get instead.
|
This is deprecated and will be removed in the future. Use async_get instead.
|
||||||
"""
|
"""
|
||||||
|
report(
|
||||||
|
"uses deprecated `async_get_registry` to access area registry, use async_get instead"
|
||||||
|
)
|
||||||
return async_get(hass)
|
return async_get(hass)
|
||||||
|
|
||||||
|
|
||||||
|
@ -720,6 +720,9 @@ async def async_get_registry(hass: HomeAssistant) -> DeviceRegistry:
|
|||||||
|
|
||||||
This is deprecated and will be removed in the future. Use async_get instead.
|
This is deprecated and will be removed in the future. Use async_get instead.
|
||||||
"""
|
"""
|
||||||
|
report(
|
||||||
|
"uses deprecated `async_get_registry` to access device registry, use async_get instead"
|
||||||
|
)
|
||||||
return async_get(hass)
|
return async_get(hass)
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ from homeassistant.util.yaml import load_yaml
|
|||||||
|
|
||||||
from . import device_registry as dr, storage
|
from . import device_registry as dr, storage
|
||||||
from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED
|
from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED
|
||||||
|
from .frame import report
|
||||||
from .typing import UNDEFINED, UndefinedType
|
from .typing import UNDEFINED, UndefinedType
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@ -819,6 +820,9 @@ async def async_get_registry(hass: HomeAssistant) -> EntityRegistry:
|
|||||||
|
|
||||||
This is deprecated and will be removed in the future. Use async_get instead.
|
This is deprecated and will be removed in the future. Use async_get instead.
|
||||||
"""
|
"""
|
||||||
|
report(
|
||||||
|
"uses deprecated `async_get_registry` to access entity registry, use async_get instead"
|
||||||
|
)
|
||||||
return async_get(hass)
|
return async_get(hass)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user