2 * intres - intelligent reside
4 * author: hackbard@hackdaworld.org
20 get_thermos: function() {
21 xhr("POST","cgi-bin/fhemwrapper","list",
24 var thermos=ret.match(/\ \ MAX_[0-9,a-f]{6}\ /g);
25 thermo.get_thermo_details(thermos);
29 get_thermo_details: function(thermos) {
30 for(var th in thermos) {
33 xhr("POST","cgi-bin/fhemwrapper","list "+id,
35 var id=ret.match(/NAME.*/)+'';
36 id=id.replace(/NAME\s+/,"");
37 var alias=ret.match(/alias.*/)+'';
38 alias=alias.replace(/alias\s+/,"");
39 var state=ret.match(/STATE.*/)+'';
40 state=state.replace(/STATE\s+/,"");
41 var eco=ret.match(/ecoTemperature.*/)+'';
42 eco=eco.replace(/.*ecoTemperature\s+/,"");
43 var comfort=ret.match(/comfortTemperature.*/)+'';
44 comfort=comfort.replace(/.*comfortTemperature\s+/,"");
45 thermo.thermos[id]={};
46 thermo.thermos[id].alias=alias;
47 thermo.thermos[id].state=state;
48 thermo.thermos[id].eco=eco;
49 thermo.thermos[id].comfort=comfort;
50 thermo.draw_thermos();
54 draw_thermo: function(alias,name,state,eco,comfort) {
56 html+="<div class=thermoalias>"+alias+"</div>";
57 html+="<div class=thermoname>"+name+"</div>";
58 html+="<div class=thermostate>"+state+"</div>";
59 html+="<div class=thermoeco>"+eco+"</div>";
60 html+="<div class=thermocomfort>"+comfort+"</div>";
63 draw_thermos: function() {
65 for(var i in thermo.thermos) {
66 var th=thermo.thermos[i];
67 html+=thermo.draw_thermo(th.alias,i,th.state,
70 $('div#thermobody').html(html);
76 $('#cmdout').css('display','none');
77 $('#cmdin').keydown(function(key) {
83 var cmdline=$('#cmdin').val();
84 xhr("POST","cgi-bin/fhemwrapper",cmdline,function(ret) {
85 $('#cmdout').css('display','block');
86 $('#cmdouttxt').val(ret);
94 document.addEventListener('deviceready',intres.startup,false);
106 $(document).ready(function() {
107 if(Modernizr.hasEvent('deviceready')) {