Closed SecT0uch closed 3 years ago
What if I set 2 schedules linked to 2 events as such:
* 8-20 * * *
: trigger an event Switch
1 every minute from 8:00 to 20:59* 0-7,21-23 * * *
: trigger an event Switch
0 every minute from 0:00 to 7:59 and 21:00 to 23:59Would it be a problem to trigger the same event every minute ?
I see there are checks in turn_on()
and turn_off()
functions, but what about Redis and logger spamming ?
To avoid logger spamming, we could change this LOG_LEVEL
to debug
and add a info
logs to turn_on()
and turn_off()
(after this check)
I can PR for that :)
BTW, is the Redis db fully in memory or does it also write on the disk ? (Limiting I/O to preserve SD cards)
These are wonderful suggestions. Check out the new v0.10.0 that was in the works. https://github.com/mudpi/mudpi-core/commit/809f998aeec62af7ddef827326065177e5bf7c50
I think some of the issue you had with triggers will be resolved. However I do have plans for more trigger options following the update. One of them is very similar to the suggestion you make. Let me know if the new changes get the behavor you are looking for. If not perhaps the triggers I have planned are what you are thinking of then. I want to provide the option to use cron strings and also just time based (timers) to give a variety of choices.
Let me know what you think of the updates and if this resolves the issues.
My board is currently used in production, but can wait to put my hands on the new version. I will let you know as soon as I'm able to test :)
Hey,
I'm thinking about a way to improve the Time Trigger scheduling.
My initial concern was to be able to detect if we missed a schedule and correct the relay position. Exemple:
I know this is possible use pycron's
has_been()
function.Shouldn't we change the Time Trigger declaration or create a new trigger type
daily_schedule
? It would take 2 options, let's sayschedule_on
andschedule_off
.In the init we would add something like:
Do you have any better idea on how to implement this?
I can contribute to implement that if needed.