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
pull/114741/head
J. Nick Koston 2024-04-02 23:49:32 -10:00 committed by GitHub
parent 74d8c6cce4
commit 41a88c876d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

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