Use assignment expressions [K-Z] (#66881)
This commit is contained in:
parent
d76687d672
commit
6e49b0e122
20 changed files with 22 additions and 51 deletions
|
@ -56,8 +56,7 @@ async def async_get_triggers(
|
|||
) -> list[dict[str, Any]]:
|
||||
"""List device triggers for LCN devices."""
|
||||
device_registry = dr.async_get(hass)
|
||||
device = device_registry.async_get(device_id)
|
||||
if device is None:
|
||||
if (device := device_registry.async_get(device_id)) is None:
|
||||
return []
|
||||
|
||||
identifier = next(iter(device.identifiers))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue