Use assignment expressions 09 (#57790)

This commit is contained in:
Marc Mueller 2021-10-17 20:19:56 +02:00 committed by GitHub
parent aa7dc78a1e
commit 2b72b7b7b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 37 additions and 91 deletions

View file

@ -30,9 +30,7 @@ async def _async_reproduce_state(
reproduce_options: dict[str, Any] | None = None,
) -> None:
"""Reproduce a single state."""
cur_state = hass.states.get(state.entity_id)
if cur_state is None:
if (cur_state := hass.states.get(state.entity_id)) is None:
_LOGGER.warning("Unable to find entity %s", state.entity_id)
return