fdia module
- fdia.log_level = None
Define code logging
- async fdia.camera_task(shutdown_event, config, loop, camera_task_queue_async, message_task_queue)
Asynchronously runs the camera task.
- Args:
shutdown_event (threading.Event): The event used to signal the shutdown of the task. config (config_util.Configuration): The configuration object. loop (asyncio.AbstractEventLoop): The event loop. camera_task_queue_async (asyncio.Queue): The asynchronous queue for camera tasks. message_task_queue (queue.Queue): The queue for message tasks.
- Returns:
None
This function starts the camera task by creating a Camera object with the provided configuration, event loop, and queues. It then enters a loop that continues until the shutdown event is set. Inside the loop, it calls the start method of the Camera object and waits for 0.1 seconds before the next iteration. After the loop exits, it logs that the camera task shutdown is complete.
- Parameters:
shutdown_event (Event)
config (Configuration)
camera_task_queue_async (Queue)
message_task_queue (Queue)
- fdia.main()
The main function that starts the program.
This function initializes the necessary objects and threads for the program to run. It sets up the configuration, creates instances of the Telegram bot and the camera thread, and starts the threads. It then enters a loop that continues until a keyboard interrupt is received. Inside the loop, it waits for 0.01 seconds before the next iteration. After the loop exits, it sets the shutdown event, joins all the threads, and exits the program.
- Parameters:
None
- Returns:
None
- Return type:
None