summaryrefslogtreecommitdiff
path: root/src/home/database/inverter.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/home/database/inverter.py')
-rw-r--r--src/home/database/inverter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/home/database/inverter.py b/src/home/database/inverter.py
index 8ebfae2..756186c 100644
--- a/src/home/database/inverter.py
+++ b/src/home/database/inverter.py
@@ -158,7 +158,7 @@ class InverterDatabase:
ranges = [[None, None]]
while rows is None or len(rows) > 0:
- if ranges[len(ranges) - 1][0] is None:
+ if ranges[len(ranges)-1][0] is None:
condition = cond_start
range_idx = 0
else:
@@ -182,6 +182,8 @@ class InverterDatabase:
if ranges[len(ranges)-1][0] is None:
ranges.pop()
+ elif ranges[len(ranges)-1][1] is None:
+ ranges[len(ranges)-1][1] = dt_to - timedelta(seconds=1)
return ranges