diff --git a/homeassistant/components/config/__init__.py b/homeassistant/components/config/__init__.py index 1098594a04..7d07710a4d 100644 --- a/homeassistant/components/config/__init__.py +++ b/homeassistant/components/config/__init__.py @@ -65,11 +65,11 @@ async def async_setup(hass, config): hass.bus.async_listen(EVENT_COMPONENT_LOADED, component_loaded) - tasks = [setup_panel(panel_name) for panel_name in SECTIONS] + tasks = [asyncio.create_task(setup_panel(panel_name)) for panel_name in SECTIONS] for panel_name in ON_DEMAND: if panel_name in hass.config.components: - tasks.append(setup_panel(panel_name)) + tasks.append(asyncio.create_task(setup_panel(panel_name))) if tasks: await asyncio.wait(tasks) diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index 5f60d84f40..b7583d80f8 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -153,7 +153,7 @@ async def async_setup_integration(hass: HomeAssistantType, config: ConfigType) - legacy_platforms = await async_extract_config(hass, config) setup_tasks = [ - legacy_platform.async_setup_legacy(hass, tracker) + asyncio.create_task(legacy_platform.async_setup_legacy(hass, tracker)) for legacy_platform in legacy_platforms ] diff --git a/homeassistant/components/forked_daapd/media_player.py b/homeassistant/components/forked_daapd/media_player.py index 195ebf7e2c..724db80fab 100644 --- a/homeassistant/components/forked_daapd/media_player.py +++ b/homeassistant/components/forked_daapd/media_player.py @@ -855,7 +855,7 @@ class ForkedDaapdUpdater: ) if update_events: await asyncio.wait( - [event.wait() for event in update_events.values()] + [asyncio.create_task(event.wait()) for event in update_events.values()] ) # make sure callbacks done before update async_dispatcher_send( self.hass, SIGNAL_UPDATE_MASTER.format(self._entry_id), True diff --git a/homeassistant/components/image_processing/__init__.py b/homeassistant/components/image_processing/__init__.py index 261278da40..e885a9ca7a 100644 --- a/homeassistant/components/image_processing/__init__.py +++ b/homeassistant/components/image_processing/__init__.py @@ -81,7 +81,7 @@ async def async_setup(hass, config): update_tasks = [] for entity in image_entities: entity.async_set_context(service.context) - update_tasks.append(entity.async_update_ha_state(True)) + update_tasks.append(asyncio.create_task(entity.async_update_ha_state(True))) if update_tasks: await asyncio.wait(update_tasks) diff --git a/homeassistant/components/mailbox/__init__.py b/homeassistant/components/mailbox/__init__.py index e5a0f16863..5d05596fb2 100644 --- a/homeassistant/components/mailbox/__init__.py +++ b/homeassistant/components/mailbox/__init__.py @@ -84,7 +84,7 @@ async def async_setup(hass, config): await component.async_add_entities([mailbox_entity]) setup_tasks = [ - async_setup_platform(p_type, p_config) + asyncio.create_task(async_setup_platform(p_type, p_config)) for p_type, p_config in config_per_platform(config, DOMAIN) ] diff --git a/homeassistant/components/microsoft_face/__init__.py b/homeassistant/components/microsoft_face/__init__.py index 69a738724c..b904642960 100644 --- a/homeassistant/components/microsoft_face/__init__.py +++ b/homeassistant/components/microsoft_face/__init__.py @@ -275,7 +275,9 @@ class MicrosoftFace: for person in persons: self._store[g_id][person["name"]] = person["personId"] - tasks.append(self._entities[g_id].async_update_ha_state()) + tasks.append( + asyncio.create_task(self._entities[g_id].async_update_ha_state()) + ) if tasks: await asyncio.wait(tasks) diff --git a/homeassistant/components/notify/__init__.py b/homeassistant/components/notify/__init__.py index d3439baf4f..1e9c7d8595 100644 --- a/homeassistant/components/notify/__init__.py +++ b/homeassistant/components/notify/__init__.py @@ -312,7 +312,7 @@ async def async_setup(hass, config): ) setup_tasks = [ - async_setup_platform(integration_name, p_config) + asyncio.create_task(async_setup_platform(integration_name, p_config)) for integration_name, p_config in config_per_platform(config, DOMAIN) ] diff --git a/homeassistant/components/stt/__init__.py b/homeassistant/components/stt/__init__.py index 43ef01a497..0ad621f070 100644 --- a/homeassistant/components/stt/__init__.py +++ b/homeassistant/components/stt/__init__.py @@ -62,7 +62,7 @@ async def async_setup(hass: HomeAssistantType, config): return setup_tasks = [ - async_setup_platform(p_type, p_config) + asyncio.create_task(async_setup_platform(p_type, p_config)) for p_type, p_config in config_per_platform(config, DOMAIN) ] diff --git a/homeassistant/components/tts/__init__.py b/homeassistant/components/tts/__init__.py index d278283baa..ff1bf946e8 100644 --- a/homeassistant/components/tts/__init__.py +++ b/homeassistant/components/tts/__init__.py @@ -194,7 +194,7 @@ async def async_setup(hass, config): ) setup_tasks = [ - async_setup_platform(p_type, p_config) + asyncio.create_task(async_setup_platform(p_type, p_config)) for p_type, p_config in config_per_platform(config, DOMAIN) ] diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index a0e8311048..3cc8348961 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -1055,7 +1055,7 @@ class Script: raise async def _async_stop(self, update_state): - aws = [run.async_stop() for run in self._runs] + aws = [asyncio.create_task(run.async_stop()) for run in self._runs] if not aws: return await asyncio.wait(aws) diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index a13b866a41..b2fa97d51c 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -602,8 +602,10 @@ async def entity_service_call( done, pending = await asyncio.wait( [ - entity.async_request_call( - _handle_entity_call(hass, entity, func, data, call.context) + asyncio.create_task( + entity.async_request_call( + _handle_entity_call(hass, entity, func, data, call.context) + ) ) for entity in entities ]