Ive been working on a custom component that simulates sensor data which is based on time of day. So, during a given day, sensors are activated to simulate some activity (motion sensors for example).
I have setup the platform fine, but now im trying to schedule updates to the simulated sensors.
Im using the async_track_point_in_time method of the helpers.event library. Im able to schedule events in the future using something like this:
evt.async_track_point_in_time( hass, async_handle_event1, dt_util.as_utc(datetime.datetime(2020, 9, 3, 23, 26)) )
This works, and the event ‘async_handle_event1’ is firing when it should. However my question is this:
I was digging into the code trying to understand what this helper does. I want to be able to verify somehow at a low level that these events are truly being scheduled because im going to schedule a lot of them.
When I call async_track_point_in_time(), I realize it converts the time and then calls async_track_point_in_utc_time(), but then it calls hass.loop.call_at() which I assume set up a task on the event loop to be called at a particular time. The function call_at() is part of the asyncio module. I used the call asyncio.all_tasks() to try to see the pending task but I dont see anything in the long list of running tasks that would signify this pending task. It seems to just call running tasks. So where is this future task stored until its run? Is there a way to see that?
Im sorry if my request is not fully technically accurate. Maybe what im looking for isnt even possible. Im just looking for a way to see a list of all the future scheduled tasks.
Thanks for your time.