From 2b188237bb132e6409917abaf6b0714d4c85213f Mon Sep 17 00:00:00 2001 From: mattbk Date: Tue, 28 Nov 2017 03:45:44 +0000 Subject: [PATCH] Only use increasing temperature values. --- pi_temp.py | 2 +- templates/history.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pi_temp.py b/pi_temp.py index 4df3649..db209a0 100755 --- a/pi_temp.py +++ b/pi_temp.py @@ -141,7 +141,7 @@ def history(): # Calculate streak lengths. Based on https://stackoverflow.com/a/33403822/2152245. def streak_lengths(x): # find the boundaries where numbers are not consecutive - boundaries = [i for i in range(1, len(x)) if x[i] < x[i-1]] + boundaries = [i for i in range(1, len(x)) if x[i] <= x[i-1]] # add the start and end boundaries boundaries = [0] + boundaries + [len(x)] # take the boundaries as pairwise slices diff --git a/templates/history.html b/templates/history.html index 7a34c6a..5678962 100755 --- a/templates/history.html +++ b/templates/history.html @@ -82,7 +82,9 @@
+
{{ debug }} +