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 thermo.thermos[id]={};
42 thermo.thermos[id].alias=alias;
43 thermo.thermos[id].temp=state;
44 thermo.draw_thermos();
48 draw_thermos: function() {
50 for(var i in thermo.thermos) {
51 var th=thermo.thermos[i];
52 html+=th.alias+" "+th.temp+"<br>";
54 tdiv=$('div#thermobody');
61 $('#cmdout').css('display','none');
62 $('#cmdin').keydown(function(key) {
68 var cmdline=$('#cmdin').val();
69 xhr("POST","cgi-bin/fhemwrapper",cmdline,function(ret) {
70 $('#cmdout').css('display','block');
71 $('#cmdouttxt').val(ret);
79 document.addEventListener('deviceready',intres.startup,false);
91 $(document).ready(function() {
92 if(Modernizr.hasEvent('deviceready')) {