X-Git-Url: https://hackdaworld.org/gitweb/?p=outofuni%2Fintres.git;a=blobdiff_plain;f=js%2Fintres.js;fp=js%2Fintres.js;h=edbf31725b19d8ff636c9fc35b4bfac8ed973c73;hp=abfce1594e1003d83ef950bbbedad62fc9e7c7c7;hb=b7355fb9902ebc88d3112881cee8fda558b7025b;hpb=9c606ddd7fe36bb1d01be39cd2ad75376dc437a3 diff --git a/js/intres.js b/js/intres.js index abfce15..edbf317 100644 --- a/js/intres.js +++ b/js/intres.js @@ -38,21 +38,36 @@ var thermo = { alias=alias.replace(/alias\s+/,""); var state=ret.match(/STATE.*/)+''; state=state.replace(/STATE\s+/,""); + var eco=ret.match(/ecoTemperature.*/)+''; + eco=eco.replace(/.*ecoTemperature\s+/,""); + var comfort=ret.match(/comfortTemperature.*/)+''; + comfort=comfort.replace(/.*comfortTemperature\s+/,""); thermo.thermos[id]={}; thermo.thermos[id].alias=alias; - thermo.thermos[id].temp=state; + thermo.thermos[id].state=state; + thermo.thermos[id].eco=eco; + thermo.thermos[id].comfort=comfort; thermo.draw_thermos(); }); } }, + draw_thermo: function(alias,name,state,eco,comfort) { + var html=""; + html+="
"+alias+"
"; + html+="
"+name+"
"; + html+="
"+state+"
"; + html+="
"+eco+"
"; + html+="
"+comfort+"
"; + return html; + }, draw_thermos: function() { var html=""; for(var i in thermo.thermos) { var th=thermo.thermos[i]; - html+=th.alias+" "+th.temp+"
"; + html+=thermo.draw_thermo(th.alias,i,th.state, + th.eco,th.comfort); } - tdiv=$('div#thermobody'); - tdiv.html(html); + $('div#thermobody').html(html); } };