convert start_at values as int during append
This commit is contained in:
parent
84cff91e41
commit
98b23e621f
1 changed files with 2 additions and 2 deletions
|
@ -124,10 +124,10 @@ def fallback_search(database):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
# append the hours in the working set
|
# append the hours in the working set
|
||||||
scheduled_hours.append(value['start_at'])
|
scheduled_hours.append(int(value['start_at']))
|
||||||
|
|
||||||
# convert the scheduled hours to a circular list
|
# convert the scheduled hours to a circular list
|
||||||
scheduled_hours = scheduled_hours + [int(h) + 24 for h in scheduled_hours]
|
scheduled_hours = scheduled_hours + [h + 24 for h in scheduled_hours]
|
||||||
|
|
||||||
# find the closest scheduled hour
|
# find the closest scheduled hour
|
||||||
closest_hour = min(scheduled_hours, key=lambda x: abs(x - current_hour))
|
closest_hour = min(scheduled_hours, key=lambda x: abs(x - current_hour))
|
||||||
|
|
Loading…
Reference in a new issue