Use assignment expressions 12 (#57937)

This commit is contained in:
Marc Mueller 2021-10-20 23:34:08 +02:00 committed by GitHub
parent 7353ea5416
commit 4513ee4ea5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 30 additions and 62 deletions

View file

@ -52,8 +52,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
if not source_match(from_state, source) and not source_match(to_state, source):
return
zone_state = hass.states.get(zone_entity_id)
if zone_state is None:
if (zone_state := hass.states.get(zone_entity_id)) is None:
_LOGGER.warning(
"Unable to execute automation %s: Zone %s not found",
automation_info["name"],