Remove deprecated async_get_registry (#91928)

Deprecated in 2021 via #46265, report was added a year ago in #72088
This commit is contained in:
J. Nick Koston 2023-04-23 22:02:21 -05:00 committed by GitHub
parent f3838dde3a
commit fba7c6cacd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 44 deletions

View file

@ -8,11 +8,9 @@ from typing import Any, cast
import attr
from homeassistant.core import HomeAssistant, callback
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
@ -282,19 +280,6 @@ async def async_load(hass: HomeAssistant) -> None:
await hass.data[DATA_REGISTRY].async_load()
@bind_hass
async def async_get_registry(hass: HomeAssistant) -> AreaRegistry:
"""Get area registry.
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)
def normalize_area_name(area_name: str) -> str:
"""Normalize an area name by removing whitespace and case folding."""
return area_name.casefold().replace(" ", "")

View file

@ -13,7 +13,6 @@ from homeassistant.backports.enum import StrEnum
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError, RequiredParameterMissing
from homeassistant.loader import bind_hass
from homeassistant.util.json import format_unserializable_data
import homeassistant.util.uuid as uuid_util
@ -749,19 +748,6 @@ async def async_load(hass: HomeAssistant) -> None:
await hass.data[DATA_REGISTRY].async_load()
@bind_hass
async def async_get_registry(hass: HomeAssistant) -> DeviceRegistry:
"""Get device registry.
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)
@callback
def async_entries_for_area(registry: DeviceRegistry, area_id: str) -> list[DeviceEntry]:
"""Return entries that match an area."""

View file

@ -42,13 +42,11 @@ from homeassistant.core import (
valid_entity_id,
)
from homeassistant.exceptions import MaxLengthExceeded
from homeassistant.loader import bind_hass
from homeassistant.util import slugify, uuid as uuid_util
from homeassistant.util.json import format_unserializable_data
from . import device_registry as dr, storage
from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED
from .frame import report
from .json import JSON_DUMP, find_paths_unserializable_data
from .typing import UNDEFINED, UndefinedType
@ -1097,19 +1095,6 @@ async def async_load(hass: HomeAssistant) -> None:
await hass.data[DATA_REGISTRY].async_load()
@bind_hass
async def async_get_registry(hass: HomeAssistant) -> EntityRegistry:
"""Get entity registry.
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)
@callback
def async_entries_for_device(
registry: EntityRegistry, device_id: str, include_disabled_entities: bool = False