Use assignment expressions [K-Z] (#66881)

This commit is contained in:
Marc Mueller 2022-02-19 17:19:46 +01:00 committed by GitHub
parent d76687d672
commit 6e49b0e122
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 22 additions and 51 deletions

View file

@ -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))