eventMap comfusion with dropdown handling. Temporary hack.

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1904 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2012-09-30 07:03:27 +00:00
parent 3b557a6c58
commit d1539ed386

View File

@@ -1089,24 +1089,29 @@ FW_showRoom()
$firstIdx=1;
} else { ##### Dropdown
$firstIdx=1;
my @tv = split(",", $values);
if($cmd eq "desired-temp") {
$txt = ReadingsVal($d, "desired-temp", 20);
$txt =~ s/ .*//; # Cut off Celsius
$txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/);
} else {
$txt = Value($d);
$txt =~ s/$cmd //;
# Hack: eventmap (translation only) should not result in a dropdown.
# eventMap/webCmd/etc handling must be cleaned up.
if(@tv > 1) {
$firstIdx=1;
if($cmd eq "desired-temp") {
$txt = ReadingsVal($d, "desired-temp", 20);
$txt =~ s/ .*//; # Cut off Celsius
$txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/);
} else {
$txt = Value($d);
$txt =~ s/$cmd //;
}
FW_pO "<td>".
FW_hidden("arg.$d", $cmd) .
FW_hidden("dev.$d", $d) .
($FW_room ? FW_hidden("room", $FW_room) : "") .
FW_select("val.$d", \@tv, $txt, "dropdown").
"</td><td>".
FW_submit("cmd.$d", "set").
"</td>";
}
FW_pO "<td>".
FW_hidden("arg.$d", $cmd) .
FW_hidden("dev.$d", $d) .
($FW_room ? FW_hidden("room", $FW_room) : "") .
FW_select("val.$d", \@tv, $txt, "dropdown").
"</td><td>".
FW_submit("cmd.$d", "set").
"</td>";
}
}