Use assignment expressions 11 (#57792)

This commit is contained in:
Marc Mueller 2021-10-17 20:15:48 +02:00 committed by GitHub
parent 238b488642
commit aa7dc78a1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 45 additions and 111 deletions

View file

@ -41,9 +41,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