mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 10:46:03 +00:00
eventMap comfusion with dropdown handling. Temporary hack.
git-svn-id: https://svn.fhem.de/fhem/trunk@1904 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bde6475e8b
commit
a9eaa005bb
@ -1089,24 +1089,29 @@ FW_showRoom()
|
|||||||
$firstIdx=1;
|
$firstIdx=1;
|
||||||
|
|
||||||
} else { ##### Dropdown
|
} else { ##### Dropdown
|
||||||
$firstIdx=1;
|
|
||||||
my @tv = split(",", $values);
|
my @tv = split(",", $values);
|
||||||
if($cmd eq "desired-temp") {
|
# Hack: eventmap (translation only) should not result in a dropdown.
|
||||||
$txt = ReadingsVal($d, "desired-temp", 20);
|
# eventMap/webCmd/etc handling must be cleaned up.
|
||||||
$txt =~ s/ .*//; # Cut off Celsius
|
if(@tv > 1) {
|
||||||
$txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/);
|
$firstIdx=1;
|
||||||
} else {
|
if($cmd eq "desired-temp") {
|
||||||
$txt = Value($d);
|
$txt = ReadingsVal($d, "desired-temp", 20);
|
||||||
$txt =~ s/$cmd //;
|
$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>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user