Upgrade pyupgrade to 2.21.2, apply its changes (#52987)

This commit is contained in:
Ville Skyttä
2021-07-19 11:46:09 +03:00
committed by GitHub
parent c96f01df1f
commit 470f2dd73f
73 changed files with 152 additions and 162 deletions

View File

@@ -239,7 +239,7 @@ async def async_validate_actions_config(
) -> list[ConfigType]:
"""Validate a list of actions."""
return await asyncio.gather(
*[async_validate_action_config(hass, action) for action in actions]
*(async_validate_action_config(hass, action) for action in actions)
)
@@ -880,10 +880,10 @@ async def _async_stop_scripts_after_shutdown(hass, point_in_time):
names = ", ".join([script["instance"].name for script in running_scripts])
_LOGGER.warning("Stopping scripts running too long after shutdown: %s", names)
await asyncio.gather(
*[
*(
script["instance"].async_stop(update_state=False)
for script in running_scripts
]
)
)
@@ -902,7 +902,7 @@ async def _async_stop_scripts_at_shutdown(hass, event):
names = ", ".join([script["instance"].name for script in running_scripts])
_LOGGER.debug("Stopping scripts running at shutdown: %s", names)
await asyncio.gather(
*[script["instance"].async_stop() for script in running_scripts]
*(script["instance"].async_stop() for script in running_scripts)
)