canvas-medical / canvas-plugins

1 stars 0 forks source link

Add support for periodic tasks with cron schedules #75

Closed aduane closed 2 months ago

aduane commented 2 months ago

This would be paired with a recurring task in home-app that just calls send_to_plugin_runner every minute with the timestamp. (I have that code working and will make a PR tomorrow.)

This PR also makes the distinction between a protocol and other, non-protocol event handlers. A CronTask is not a protocol. It is an event handler that responds to the CRON event, and expects a SCHEDULE constant and an execute method to be defined.

aduane commented 2 months ago

I love the simplicity of this.