mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Cleanup unreachable code where device_entry will never be None on an update event (#91855)
This commit is contained in:
parent
3f6541a6db
commit
88f0e4000b
@ -1193,10 +1193,9 @@ 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)
|
||||||
if not (device_entry := device_registry.async_get(device_id)):
|
if (
|
||||||
# The device is already removed, do cleanup when we get "remove" event
|
device_entry := device_registry.async_get(device_id)
|
||||||
return False
|
) and config_entry_id in device_entry.config_entries:
|
||||||
if config_entry_id in device_entry.config_entries:
|
|
||||||
# Not removed from device
|
# Not removed from device
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user