mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Small cleanup of MQTT mixins (#66812)
This commit is contained in:
parent
faf854190d
commit
fcf774ecfc
@ -839,12 +839,11 @@ def async_removed_from_device(
|
||||
if "config_entries" not in event.data["changes"]:
|
||||
return False
|
||||
device_registry = dr.async_get(hass)
|
||||
device_entry = device_registry.async_get(mqtt_device_id)
|
||||
device_entry = device_registry.async_get(device_id)
|
||||
if not device_entry:
|
||||
# The device is already removed, do cleanup when we get "remove" event
|
||||
return False
|
||||
entry_id = config_entry_id
|
||||
if entry_id in device_entry.config_entries:
|
||||
if config_entry_id in device_entry.config_entries:
|
||||
# Not removed from device
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user