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
3 changed files with 11 additions and 0 deletions
|
@ -12,6 +12,7 @@ from homeassistant.loader import bind_hass
|
|||
from homeassistant.util import slugify
|
||||
|
||||
from . import device_registry as dr, entity_registry as er
|
||||
from .frame import report
|
||||
from .storage import Store
|
||||
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.
|
||||
"""
|
||||
report(
|
||||
"uses deprecated `async_get_registry` to access area registry, use async_get instead"
|
||||
)
|
||||
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.
|
||||
"""
|
||||
report(
|
||||
"uses deprecated `async_get_registry` to access device registry, use async_get instead"
|
||||
)
|
||||
return async_get(hass)
|
||||
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ from homeassistant.util.yaml import load_yaml
|
|||
|
||||
from . import device_registry as dr, storage
|
||||
from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED
|
||||
from .frame import report
|
||||
from .typing import UNDEFINED, UndefinedType
|
||||
|
||||
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.
|
||||
"""
|
||||
report(
|
||||
"uses deprecated `async_get_registry` to access entity registry, use async_get instead"
|
||||
)
|
||||
return async_get(hass)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue