mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use entity_registry async_get for AsusWrt (#58885)
This commit is contained in:
parent
f51e1fcb67
commit
20a443ad6c
@ -24,6 +24,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
@ -249,11 +250,9 @@ class AsusWrtRouter:
|
|||||||
self._sw_v = f"{firmware['firmver']} (build {firmware['buildno']})"
|
self._sw_v = f"{firmware['firmver']} (build {firmware['buildno']})"
|
||||||
|
|
||||||
# Load tracked entities from registry
|
# Load tracked entities from registry
|
||||||
entity_registry = await self.hass.helpers.entity_registry.async_get_registry()
|
track_entries = er.async_entries_for_config_entry(
|
||||||
track_entries = (
|
er.async_get(self.hass),
|
||||||
self.hass.helpers.entity_registry.async_entries_for_config_entry(
|
self._entry.entry_id,
|
||||||
entity_registry, self._entry.entry_id
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
for entry in track_entries:
|
for entry in track_entries:
|
||||||
if entry.domain == TRACKER_DOMAIN:
|
if entry.domain == TRACKER_DOMAIN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user