Skip to content

Commit

Permalink
time logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bwees committed Dec 25, 2023
1 parent c49c7f2 commit dcfea5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def preflight():
# verify we have an image
today = str(datetime.datetime.now().date())
if not os.path.exists("static/images/" + today + ".bmp"):
print("No")
return "0"

# check if current time is +- 30 mins of 3:00 AM
Expand All @@ -176,7 +177,7 @@ def preflight():

if now.hour == t_wakeup and now.minute < 30:
return "1"
elif now.hour == t_wakeup+1 and now.minute > 30:
elif now.hour == t_wakeup-1 and now.minute > 30:
return "1"

return "0"
Expand Down

0 comments on commit dcfea5e

Please sign in to comment.