From ebdd42356446de079da185fe22675f197de0bf38 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 13 May 2016 10:27:34 +0100 Subject: [PATCH] Avoid plotting invalid temperature sensor values. --- static/sensor-hub.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/sensor-hub.html b/static/sensor-hub.html index 6174906..1aa39fa 100644 --- a/static/sensor-hub.html +++ b/static/sensor-hub.html @@ -112,7 +112,10 @@ function on_draw_graph(data) { $.each(data.result, function(i,item) { var t = item.timestamp*1000; $.each(item.sensors, function(n, sensor) { - plotdata[n].data.push([t,sensor.value]); + var v = sensor.value; + if (v < -100) + v = plotdata[n].data[plotdata[n].data.length - 1]; + plotdata[n].data.push([t,v]); }); }); $('#status').html(''); -- 2.23.0