Cleanup deprecated async_get_registry in geonetnz_quakes (#72064)

This commit is contained in:
epenet 2022-05-18 14:22:56 +02:00 committed by GitHub
parent 977c5b7693
commit 7c4cc389c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,9 +13,9 @@ from homeassistant.const import (
LENGTH_MILES,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.entity_registry import async_get_registry
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
from .const import DOMAIN, FEED
@ -100,7 +100,7 @@ class GeonetnzQuakesEvent(GeolocationEvent):
self._remove_signal_delete()
self._remove_signal_update()
# Remove from entity registry.
entity_registry = await async_get_registry(self.hass)
entity_registry = er.async_get(self.hass)
if self.entity_id in entity_registry.entities:
entity_registry.async_remove(self.entity_id)