Skip to content

Commit

Permalink
Switch mqtt to use async_track_device_registry_updated_event
Browse files Browse the repository at this point in the history
needs #93602
  • Loading branch information
bdraco committed May 26, 2023
1 parent b60e190 commit 6b11c82
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions homeassistant/components/mqtt/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
device_registry as dr,
entity_registry as er,
)
from homeassistant.helpers.device_registry import (
EVENT_DEVICE_REGISTRY_UPDATED,
DeviceEntry,
)
from homeassistant.helpers.device_registry import DeviceEntry
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
Expand All @@ -49,7 +46,10 @@
async_generate_entity_id,
)
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_entity_registry_updated_event
from homeassistant.helpers.event import (
async_track_device_registry_updated_event,
async_track_entity_registry_updated_event,
)
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.util.json import json_loads
Expand Down Expand Up @@ -680,8 +680,8 @@ def __init__(
)
config_entry.async_on_unload(self._entry_unload)
if device_id is not None:
self._remove_device_updated = hass.bus.async_listen(
EVENT_DEVICE_REGISTRY_UPDATED, self._async_device_removed
self._remove_device_updated = async_track_device_registry_updated_event(
hass, device_id, self._async_device_removed
)
_LOGGER.info(
"%s %s has been initialized",
Expand Down

0 comments on commit 6b11c82

Please sign in to comment.