Small cleanup of MQTT mixins (#66812)
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…
Reference in New Issue