Remove remaining async_add_job calls in core (#113217)
parent
b34302e51b
commit
41215aa954
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue