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"]:
|
if "config_entries" not in event.data["changes"]:
|
||||||
return False
|
return False
|
||||||
device_registry = dr.async_get(hass)
|
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:
|
if not device_entry:
|
||||||
# The device is already removed, do cleanup when we get "remove" event
|
# The device is already removed, do cleanup when we get "remove" event
|
||||||
return False
|
return False
|
||||||
entry_id = config_entry_id
|
if config_entry_id in device_entry.config_entries:
|
||||||
if entry_id in device_entry.config_entries:
|
|
||||||
# Not removed from device
|
# Not removed from device
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue