With version 0.3 HABApp restructured scheduling an introduced some new scheduling mechanisms like countdown.
Compared to the cron syntax with DSL rules i am missing soem features or a least there are not so easy to build.
I found out that a start time for an schedule needs to be in the future. So if i like to start a schedulrr exact on every hour i have to calculate the next start.
self.run.every(time(datetime.now().hour+1, 0, 0), timedelta(hours=1), self.myfunction)
It would be easier to write
self.run.every(0, 0, 0), timedelta(hours=1), self.myfunction)
and the scheduler starts at the next proper time.
Another thing ist that the starttime has no overflow mechanism, so we have to check if there is an overflow when adding some value. So the following will lead to an error if datetime.now.hour is 23
time(datetime.now().hour+1, 0, 0)
because for hours only allows values between 0 and 23.
So based on these two restrictions i am looking for some easy, elegant solutions to define my schedulers.
To be honest i have not checked the datetime module in deapth.
What kind of scheduler did you define with HABApp and how they are established?
Thomas