95_Dashboard: fixed rendering of devices based on the FHEMWEB algorithm
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9901 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -817,7 +817,9 @@ sub BuildGroup
|
|||||||
|
|
||||||
$row++;
|
$row++;
|
||||||
|
|
||||||
|
$extPage{group} = $groupname;
|
||||||
my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf, \%extPage);
|
my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf, \%extPage);
|
||||||
|
$allSets = FW_widgetOverride($d, $allSets);
|
||||||
|
|
||||||
############## Customize Result for Special Types #####################
|
############## Customize Result for Special Types #####################
|
||||||
my @txtarray = split(">", $txt);
|
my @txtarray = split(">", $txt);
|
||||||
@@ -837,24 +839,30 @@ sub BuildGroup
|
|||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
###### Commands, slider, dropdown
|
###### Commands, slider, dropdown
|
||||||
if(!$FW_ss && $cmdlist) {
|
my $smallscreenCommands = AttrVal($FW_wname, "smallscreenCommands", "");
|
||||||
|
if((!$FW_ss || $smallscreenCommands) && $cmdlist) {
|
||||||
|
my @a = split("[: ]", AttrVal($d, "cmdIcon", ""));
|
||||||
|
my %cmdIcon = @a;
|
||||||
foreach my $cmd (split(":", $cmdlist)) {
|
foreach my $cmd (split(":", $cmdlist)) {
|
||||||
my $htmlTxt;
|
my $htmlTxt;
|
||||||
my @c = split(' ', $cmd);
|
my @c = split(' ', $cmd);
|
||||||
if($allSets && $allSets =~ m/$c[0]:([^ ]*)/) {
|
if(int(@c) && $allSets && $allSets =~ m/\b$c[0]:([^ ]*)/) {
|
||||||
my $values = $1;
|
my $values = $1;
|
||||||
foreach my $fn (sort keys %{$data{webCmdFn}}) {
|
foreach my $fn (sort keys %{$data{webCmdFn}}) {
|
||||||
no strict "refs";
|
no strict "refs";
|
||||||
$htmlTxt = &{$data{webCmdFn}{$fn}}($FW_wname, $d, $FW_room, $cmd, $values);
|
$htmlTxt = &{$data{webCmdFn}{$fn}}($FW_wname,
|
||||||
|
$d, $FW_room, $cmd, $values);
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
last if(defined($htmlTxt));
|
last if(defined($htmlTxt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($htmlTxt) {
|
if($htmlTxt) {
|
||||||
# add colspan to avoid squeezed table cells
|
# add colspan to avoid squeezed table cells
|
||||||
$htmlTxt =~ s/<td>/<td colspan="10">/;
|
$htmlTxt =~ s/<td>/<td colspan="10">/;
|
||||||
$ret .= $htmlTxt;
|
$ret .= $htmlTxt;
|
||||||
} else {
|
} else {
|
||||||
|
my $nCmd = $cmdIcon{$cmd} ?
|
||||||
|
FW_makeImage($cmdIcon{$cmd},$cmd,"webCmd") : $cmd;
|
||||||
$ret .= FW_pH "cmd.$d=set $d $cmd$rf", $cmd, 1, "col3", 1;
|
$ret .= FW_pH "cmd.$d=set $d $cmd$rf", $cmd, 1, "col3", 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user