Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix conditional statements bug.
Browse files Browse the repository at this point in the history
[ Fixed! ]
# Fixed a bug that did not receive meal information normally in some time zones.

[ Cause ]
# Time conflict in some conditional statements
  • Loading branch information
BackGwa committed Dec 28, 2022
1 parent 99a0c6a commit db4fc67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions johnson.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ def meal_zone(JSON, usetime, meal_value):
isdr = False if ((data['menu'][0]['dinner']) == []) else True

if(isbf and islc and isdr):
if(hour > 0 and hour < 8):
if(hour >= 0 and hour < 8):
mealzone = 'breakfast'
elif(hour > 8 and hour < 14):
elif(hour >= 8 and hour < 14):
mealzone = 'lunch'
else:
mealzone = 'dinner'

elif(isbf and islc):
mealzone = 'breakfast' if (hour > 0 and hour < 8) else 'lunch'
mealzone = 'breakfast' if (hour >= 0 and hour < 8) else 'lunch'
elif(islc and isdr):
mealzone = 'lunch' if (hour > 0 and hour < 14) else 'dinner'
mealzone = 'lunch' if (hour >= 0 and hour < 14) else 'dinner'
else:
mealzone = 'lunch' if((islc) and ((not isbf) and (not isdr))) else 'None'

Expand Down

0 comments on commit db4fc67

Please sign in to comment.