arthurdent75 / SimpleScheduler

An Home Assistant AddOn to schedule entities on/off on weekly base
183 stars 36 forks source link

Setting hour to 24 crash the addon #124

Closed acseven closed 1 year ago

acseven commented 1 year ago

Hi, The addon was working fine up until I upgraded to this latest version.

It appears that no schedules are working:

[09:37:01] INFO: Starting service.d [Scheduler]
[09:37:01] INFO: Running scheduler.sh
[2023-03-15 09:37:02] STATUS: Starting scheduler
Traceback (most recent call last):
  File "/simplescheduler/scheduler.py", line 77, in <module>
    event_time = main.evaluate_event_time(t, sunrise, sunset)
  File "/simplescheduler/main.py", line 691, in evaluate_event_time
    event = datetime(2022, 1, 1, int(hm[0]), int(hm[1])).strftime("%H:%M")  # fix missing leading zeroes
ValueError: hour must be in 0..23
[09:38:00] WARNING: example 2 crashed, halting add-on
./finish: line 7: /run/s6/basedir/bin/halt: No such file or directory
acseven commented 1 year ago

Ok, solved, but very weird. The issue was that I had schedules with times like "24:02" which would obviously not work. I find it strange that I had these in the first place (meaning prior to the upgrade), but it was working before.