From 41a88c876dd3efb50bc87d92cc86de6ea699d553 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Apr 2024 23:49:32 -1000 Subject: [PATCH] Avoid useless done check in config entries async_create_task (#114695) If the task is not started with eager_start it will never be done right away --- homeassistant/config_entries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 9f5f6b9135b..212d0322af6 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -1072,7 +1072,7 @@ class ConfigEntry: task = hass.async_create_task( target, f"{name} {self.title} {self.domain} {self.entry_id}", eager_start ) - if task.done(): + if eager_start and task.done(): return task self._tasks.add(task) task.add_done_callback(self._tasks.remove)