Use entity_registry async_get for AsusWrt (#58885)

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.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: