Skip to content

Commit

Permalink
FIx charge slot list logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Dec 6, 2024
1 parent aec68a6 commit 47d702c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/ohme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ def next_slot(hass, account_id, data):
if end is None and slot['end'] > datetime.now().astimezone():
end = slot['end']

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

if collapse_slots and slot['start'] == end:
end = slot['end']
elif start is not None and end is not None:
break

return {
"start": start,
Expand Down

0 comments on commit 47d702c

Please sign in to comment.