Remove remaining async_add_job calls in core (#113217)

pull/113252/head
J. Nick Koston 2024-03-13 08:29:21 -10:00 committed by GitHub
parent b34302e51b
commit 41215aa954
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -525,13 +525,15 @@ class HomeAssistant:
raise ValueError("Don't call add_job with None")
if asyncio.iscoroutine(target):
self.loop.call_soon_threadsafe(
functools.partial(self.async_add_job, target, eager_start=True)
functools.partial(self.async_create_task, target, eager_start=True)
)
return
if TYPE_CHECKING:
target = cast(Callable[..., Any], target)
self.loop.call_soon_threadsafe(
functools.partial(self.async_add_job, target, *args, eager_start=True)
functools.partial(
self.async_add_hass_job, HassJob(target), *args, eager_start=True
)
)
@overload