From 713d7ec367e48dea4df874e51a4a50268af5ad60 Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Fri, 5 Jan 2024 11:47:04 +0000 Subject: [PATCH] Fix no end time in the last charge slot --- custom_components/ohme/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/ohme/utils.py b/custom_components/ohme/utils.py index 8053374..9d0a744 100644 --- a/custom_components/ohme/utils.py +++ b/custom_components/ohme/utils.py @@ -18,8 +18,8 @@ def charge_graph_next_slot(charge_start, points, skip_format=False): # Filter to points from now onwards data = [x for x in data if x["t"] > now] - # Give up if we have less than 3 points - if len(data) < 3: + # Give up if we have less than 2 points + if len(data) < 2: return {"start": None, "end": None} start_ts = None