Skip to content

Commit

Permalink
More next slot bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Sep 18, 2024
1 parent 29f5ddf commit 05758ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/ohme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def next_slot(hass, data):
# Loop through slots
for slot in slots:
# Only take the first slot start/end that matches. These are in order.
if end is None and slot['end'] > datetime.now().astimezone():
end = slot['end']

if start is None and slot['start'] > datetime.now().astimezone():
start = slot['start']
end = slot['end']
elif end is None and slot['end'] > datetime.now().astimezone():
end = slot['end']
elif collapse_slots and slot['start'] == end:
end = slot['end']
elif start is not None and end is not None:
Expand Down

0 comments on commit 05758ee

Please sign in to comment.