Cleanup deprecated async_get_registry in gdacs (#72066)
parent
4978d5f86e
commit
977c5b7693
|
@ -12,9 +12,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 DEFAULT_ICON, DOMAIN, FEED
|
||||
|
@ -114,7 +114,7 @@ class GdacsEvent(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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue