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+="<div class=thermoalias>"+alias+"</div>";
+ html+="<div class=thermoname>"+name+"</div>";
+ html+="<div class=thermostate>"+state+"</div>";
+ html+="<div class=thermoeco>"+eco+"</div>";
+ html+="<div class=thermocomfort>"+comfort+"</div>";
+ return html;
+ },
draw_thermos: function() {
var html="";
for(var i in thermo.thermos) {
var th=thermo.thermos[i];
- html+=th.alias+" "+th.temp+"<br>";
+ html+=thermo.draw_thermo(th.alias,i,th.state,
+ th.eco,th.comfort);
}
- tdiv=$('div#thermobody');
- tdiv.html(html);
+ $('div#thermobody').html(html);
}
};