From b7355fb9902ebc88d3112881cee8fda558b7025b Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 31 Jan 2016 17:15:38 +0100 Subject: [PATCH] thermos --- css/intres.css | 33 +++++++++++++++++++++++++++++++++ js/intres.js | 23 +++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/css/intres.css b/css/intres.css index bf19843..59be9aa 100644 --- a/css/intres.css +++ b/css/intres.css @@ -27,3 +27,36 @@ body { width:95%; } + +/* thermos */ + +.thermoalias { + margin:1%; + width:30%; + float:left; +} + +.thermoname { + margin:1%; + width:20%; + float:left; +} + +.thermostate { + margin:1%; + width:10%; + float:left; +} + +.thermoeco { + margin:1%; + width:10%; + float:left; +} + +.thermocomfort { + margin:1%; + width:10%; + float:left; +} + 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); } }; -- 2.39.2