Use assignment expressions [other] (#66882)
This commit is contained in:
parent
4f20a8023b
commit
45d8d04c40
10 changed files with 15 additions and 35 deletions
|
@ -839,8 +839,7 @@ 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(device_id)
|
||||
if not device_entry:
|
||||
if not (device_entry := device_registry.async_get(device_id)):
|
||||
# The device is already removed, do cleanup when we get "remove" event
|
||||
return False
|
||||
if config_entry_id in device_entry.config_entries:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue