mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Remove remaining async_add_job calls in core (#113217)
This commit is contained in:
parent
b34302e51b
commit
41215aa954
@ -525,13 +525,15 @@ class HomeAssistant:
|
|||||||
raise ValueError("Don't call add_job with None")
|
raise ValueError("Don't call add_job with None")
|
||||||
if asyncio.iscoroutine(target):
|
if asyncio.iscoroutine(target):
|
||||||
self.loop.call_soon_threadsafe(
|
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
|
return
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
target = cast(Callable[..., Any], target)
|
target = cast(Callable[..., Any], target)
|
||||||
self.loop.call_soon_threadsafe(
|
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
|
@overload
|
||||||
|
Loading…
x
Reference in New Issue
Block a user