Browse Source

Only Flora has moisture I think

The rest will be humidity
master
sipp11 7 years ago
parent
commit
a6dc824bc0
  1. 6
      html/home.html

6
html/home.html

@ -177,7 +177,8 @@ function displayGraph(id, data, width, height, interpolation) {
oneUrl = `${baseUrl}/id/${id}?limit=150`;
that.off('click');
$.getJSON(oneUrl, function(data, textStatus, xhr) {
var extra = (data[0]['info']['sensor'] === "dht11" ? "humidity" : "moisture");
var isFlora = data[0]['info']['sensor'].toLowerCase().indexOf("flora") > -1;
var extra = (isFlora ? 'humidity' : 'moisture');
var ks = ['temperature', extra];
for (var ik in ks) {
var key = ks[ik];
@ -196,7 +197,8 @@ function displayGraph(id, data, width, height, interpolation) {
var x = data[i];
addToList(x);
addEleToDashBoard(x);
var toHide = (x['info']['sensor'] === "dht11" ? 'moisture' : 'humidity');
var isFlora = x['info']['sensor'].toLowerCase().indexOf("flora") > -1;
var toHide = (isFlora ? 'humidity' : 'moisture');
$('#' + x['device'].replace(/:/g, '_')).find('.'+ toHide).hide();
}
reloadListener();

Loading…
Cancel
Save