diff --git a/example.conf b/example.conf index ddb27e0..ad18ebf 100644 --- a/example.conf +++ b/example.conf @@ -32,11 +32,11 @@ [[top_tiles]] Temperatuur tuin = 31, fire Temperatuur auto = 22, car - Stroomverbruik TV = 13, plug + Stroomverbruik TV = 13, plug, Usage Temperatuur Eindhoven = 54, fire Temperatuur tuin BMP = 55, fire - Totaal Playstation = 25, plug - Totaal slaapkamer lamp = 12, plug + Totaal Playstation = 25, plug, Usage + Totaal slaapkamer lamp = 12, plug, CounterToday Temperatuur raspberry = 1, car [[line_charts]] Temperatuur Slaapkamer = 14, month, temp diff --git a/static/js/domoboard.js b/static/js/domoboard.js index e1abd05..22a0f6a 100644 --- a/static/js/domoboard.js +++ b/static/js/domoboard.js @@ -57,7 +57,7 @@ function refreshSwitches(updateSwitches, block) { } // Top tiles functions -function refreshTopTiles(updateDivs, block, tilesPreviousArray) { +function refreshTopTiles(updateDivs, block, tilesPreviousArray, updateDivsTypeArray) { if (tilesPreviousArray.length == 0) { for(var i = 0; i < updateDivs.length; i++){ tilesPreviousArray.push(-1); @@ -69,7 +69,7 @@ function refreshTopTiles(updateDivs, block, tilesPreviousArray) { requestAPI(url, function(d) { var obj = JSON.parse(d); if (obj.result != undefined) { - var data = obj.result[0].Data; + var data = obj.result[0][updateDivsTypeArray[i]]; } else { var data = "-"; } diff --git a/templates/top_tiles.html b/templates/top_tiles.html index 0e370cf..bdc038a 100644 --- a/templates/top_tiles.html +++ b/templates/top_tiles.html @@ -5,7 +5,7 @@