From c04540e8a777a8ccdc4e69d96f0abf0f751a8099 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Wed, 18 Apr 2012 08:23:57 +0000 Subject: [PATCH] desired temp reworked to use the set parameter list git-svn-id: https://svn.fhem.de/fhem/trunk@1465 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index d6c0541d8..ad4715761 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -92,10 +92,11 @@ FHEMWEB_Initialize($) $hash->{DefFn} = "FW_Define"; $hash->{UndefFn} = "FW_Undef"; $hash->{NotifyFn}= "FW_Notify"; - $hash->{AttrList}= "loglevel:0,1,2,3,4,5,6 webname fwmodpath fwcompress " . + $hash->{AttrList}= "loglevel:0,1,2,3,4,5,6 webname fwmodpath fwcompress:0,1 ". "plotmode:gnuplot,gnuplot-scroll,SVG plotsize refresh " . "touchpad smallscreen plotfork basicAuth basicAuthMsg ". - "stylesheetPrefix hiddenroom HTTPS longpoll redirectCmds "; + "stylesheetPrefix hiddenroom HTTPS longpoll:1,0 ". + "redirectCmds:0,1 "; ############### # Initialize internal structures @@ -929,23 +930,26 @@ FW_showRoom() FW_pO ""; if($cmdlist) { foreach my $cmd (split(":", $cmdlist)) { - FW_pH "cmd.$d=set $d $cmd$rf", ReplaceEventMap($d,$cmd,1), 1, "col3"; + FW_pH "cmd.$d=set $d $cmd$rf", ReplaceEventMap($d,$cmd,1),1,"col3"; } - } elsif($allSets =~ m/ desired-temp /) { + } elsif($allSets =~ m/ desired-temp:([^ ]*)/) { + my @tv = split(",", $1); $txt = ReadingsVal($d, "measured-temp", ""); $txt =~ s/ .*//; $txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/); - my @tv = split(" ", getAllSets("$d desired-temp")); $txt = int($txt*20)/$txt if($txt =~ m/^[0-9].$/); FW_pO "". - FW_hidden("arg.$d", "desired-temp") . - FW_hidden("dev.$d", $d) . - FW_select("val.$d", \@tv, ReadingsVal($d, "desired-temp", $txt),"fht") . - "". - FW_submit("cmd.$d", "set"). - ""; + FW_hidden("arg.$d", "desired-temp") . + FW_hidden("dev.$d", $d) . + ($FW_room ? FW_hidden("room", $FW_room) : "") . + FW_select("val.$d", \@tv, + ReadingsVal($d, "desired-temp", $txt),"fht") . + "". + FW_submit("cmd.$d", "set"). + ""; + } elsif($type eq "FileLog") { $row = FW_dumpFileLog($d, 1, $row);