Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import os
import yaml

THIS_VERSION = "v7.14.37"
THIS_VERSION = "v7.14.38"
TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
TIME_FORMAT_SECONDS = "%Y-%m-%dT%H:%M:%S.%f%z"
TIME_FORMAT_OCTOPUS = "%Y-%m-%d %H:%M:%S%z"
Expand Down Expand Up @@ -3309,9 +3309,9 @@ def get_from_incrementing(self, data, index, backwards=True):
while index < 0:
index += 24 * 60
if backwards:
return data.get(index, 0) - data.get(index + 1, 0)
return max(data.get(index, 0) - data.get(index + 1, 0), 0)
else:
return data.get(index + 1, 0) - data.get(index, 0)
return max(data.get(index + 1, 0) - data.get(index, 0), 0)

def record_length(self, charge_window, charge_limit, best_price):
"""
Expand Down