Skip to content

Commit

Permalink
Fix crash in discharge_unused_charge_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
springfall2008 authored Jul 10, 2023
1 parent a5cfeca commit 65b5dc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@ def discard_unused_charge_slots(self, charge_limit_best, charge_window_best, res
window = charge_window_best[window_n]
start = window['start']
end = window['end']
if (charge_limit_best[window_n] > self.dp2(reserve)) or (self.minutes_now >= start and self.minutes_now < end and self.charge_limit and self.charge_limit[0]['end'] == end):
if (charge_limit_best[window_n] > self.dp2(reserve)) or (self.minutes_now >= start and self.minutes_now < end and self.charge_window and self.charge_window[0]['end'] == end):
new_limit_best.append(charge_limit_best[window_n])
new_window_best.append(charge_window_best[window_n])
return new_limit_best, new_window_best
Expand Down

0 comments on commit 65b5dc7

Please sign in to comment.