Adjust entity registry access in core platforms (#88944)

* Adjust entity registry access in platforms

* Adjust more core components
This commit is contained in:
epenet 2023-03-01 08:02:16 +01:00 committed by GitHub
parent 50f908ce2d
commit f2b736fad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 154 additions and 121 deletions

View file

@ -14,7 +14,7 @@ from homeassistant.const import (
)
from homeassistant.core import Context, HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry
from homeassistant.helpers import entity_registry as er
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import get_capability
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
@ -74,7 +74,7 @@ async def async_get_actions(
hass: HomeAssistant, device_id: str
) -> list[dict[str, str]]:
"""List device actions for Select devices."""
registry = entity_registry.async_get(hass)
registry = er.async_get(hass)
return [
{
CONF_DEVICE_ID: device_id,
@ -89,7 +89,7 @@ async def async_get_actions(
SERVICE_SELECT_OPTION,
SERVICE_SELECT_PREVIOUS,
)
for entry in entity_registry.async_entries_for_device(registry, device_id)
for entry in er.async_entries_for_device(registry, device_id)
if entry.domain == DOMAIN
]