Fixed timedelta comparisons
This commit is contained in:
parent
e5ce38851c
commit
2f1e131d4b
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ def get_scene_for_time(time: time) -> string:
|
||||||
previous_scene = None
|
previous_scene = None
|
||||||
for start_time, scene in SCHEDULE.items():
|
for start_time, scene in SCHEDULE.items():
|
||||||
# If current time is still after schedule time, just keep going
|
# If current time is still after schedule time, just keep going
|
||||||
if time_minus_time(start_time, time) < 0:
|
if time_minus_time(start_time, time) < timedelta(0):
|
||||||
previous_scene = scene
|
previous_scene = scene
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ def register_time_triggers():
|
||||||
|
|
||||||
for time in SCHEDULE.keys():
|
for time in SCHEDULE.keys():
|
||||||
delta = time_minus_time(time, datetime.now().time())
|
delta = time_minus_time(time, datetime.now().time())
|
||||||
if delta < 0:
|
if delta < timedelta(0):
|
||||||
delta += timedelta(1)
|
delta += timedelta(1)
|
||||||
|
|
||||||
timeloop._add_job(update_scene, interval=timedelta(1), offset=delta)
|
timeloop._add_job(update_scene, interval=timedelta(1), offset=delta)
|
||||||
|
|
Loading…
Reference in a new issue