1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Enable RUFF ICN001 for registries (#88875)

* Add issue_registry to RUFF extend aliases

* Add area_registry to RUFF extend aliases

* Add device_registry to RUFF extend aliases

* Add entity_registry to RUFF extend aliases

* Adjust scaffold
This commit is contained in:
epenet
2023-03-01 18:40:26 +01:00
committed by GitHub
parent 3f32c5d2ad
commit bdbec491eb
4 changed files with 18 additions and 12 deletions

View File

@@ -21,7 +21,7 @@ from homeassistant.const import (
STATE_ON,
)
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers import config_validation as cv, entity_registry as er
from homeassistant.helpers.typing import ConfigType
from . import DOMAIN
@@ -41,7 +41,7 @@ async def async_get_triggers(
hass: HomeAssistant, device_id: str
) -> list[dict[str, Any]]:
"""List device triggers for NEW_NAME devices."""
registry = entity_registry.async_get(hass)
registry = er.async_get(hass)
triggers = []
# TODO Read this comment and remove it.
@@ -52,7 +52,7 @@ async def async_get_triggers(
# return zha_device.device_triggers
# Get all the integrations entities for this device
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:
continue