mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Have async_track_point_in_utc_time call async_run_job directly from call_at (#37790)
We do not need a nested function here since call_at takes args
This commit is contained in:
parent
e852a2eb9b
commit
41cd90648e
@ -328,14 +328,11 @@ def async_track_point_in_utc_time(
|
||||
# Ensure point_in_time is UTC
|
||||
point_in_time = dt_util.as_utc(point_in_time)
|
||||
|
||||
@callback
|
||||
def point_in_time_listener() -> None:
|
||||
"""Listen for matching time_changed events."""
|
||||
hass.async_run_job(action, point_in_time)
|
||||
|
||||
cancel_callback = hass.loop.call_at(
|
||||
hass.loop.time() + point_in_time.timestamp() - time.time(),
|
||||
point_in_time_listener,
|
||||
hass.async_run_job,
|
||||
action,
|
||||
point_in_time,
|
||||
)
|
||||
|
||||
@callback
|
||||
|
Loading…
x
Reference in New Issue
Block a user