1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

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