From: Pat Thoyts Date: Fri, 13 May 2016 09:27:34 +0000 (+0100) Subject: Avoid plotting invalid temperature sensor values. X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=ebdd42356446de079da185fe22675f197de0bf38;p=spd%2Fsensor-hub.git Avoid plotting invalid temperature sensor values. --- 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('');