Use entity_registry async_get for AsusWrt ()

This commit is contained in:
ollo69 2021-11-01 15:18:01 +01:00 committed by GitHub
parent f51e1fcb67
commit 20a443ad6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,7 @@ from homeassistant.const import (
)
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.event import async_track_time_interval
@ -249,11 +250,9 @@ class AsusWrtRouter:
self._sw_v = f"{firmware['firmver']} (build {firmware['buildno']})"
# Load tracked entities from registry
entity_registry = await self.hass.helpers.entity_registry.async_get_registry()
track_entries = (
self.hass.helpers.entity_registry.async_entries_for_config_entry(
entity_registry, self._entry.entry_id
)
track_entries = er.async_entries_for_config_entry(
er.async_get(self.hass),
self._entry.entry_id,
)
for entry in track_entries:
if entry.domain == TRACKER_DOMAIN: