2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 01:06:04 +00:00

FIX: call summaryFn for each event (longpoll).

git-svn-id: https://svn.fhem.de/fhem/trunk@3298 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-06-17 18:13:24 +00:00
parent d02c13592c
commit 2a20ef4683

View File

@ -15,6 +15,7 @@ sub FW_iconPath($);
sub FW_answerCall($); sub FW_answerCall($);
sub FW_calcWeblink($$); sub FW_calcWeblink($$);
sub FW_dev2image($); sub FW_dev2image($);
sub FW_devState($$@);
sub FW_digestCgi($); sub FW_digestCgi($);
sub FW_doDetail($); sub FW_doDetail($);
sub FW_fatal($); sub FW_fatal($);
@ -1073,23 +1074,9 @@ FW_showRoom()
} }
$row++; $row++;
my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf); my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf, \%extPage);
my $sfn = $modules{$type}{FW_summaryFn}; FW_pO "<td id=\"$d\">$txt</td>";
my $newtxt;
if($sfn) {
no strict "refs";
$newtxt = &{$sfn}($FW_wname, $d, $FW_room, \%extPage);
use strict "refs";
}
if(defined($newtxt)) {
FW_pO "<td id=\"$type.$d\">$newtxt</td>";
} else {
FW_pO "<td id=\"$d\">$txt</td>";
}
###### ######
@ -2330,8 +2317,9 @@ FW_roomStatesForInform($)
my $data = ""; my $data = "";
my @rl = devspec2array("room=$room"); my @rl = devspec2array("room=$room");
my %extPage = ();
foreach my $dn (@rl) { foreach my $dn (@rl) {
my ($allSet, $cmdlist, $txt) = FW_devState($dn, ""); my ($allSet, $cmdlist, $txt) = FW_devState($dn, "", \%extPage);
$data .= "$dn<<$defs{$dn}{STATE}<<$txt\r\n" $data .= "$dn<<$defs{$dn}{STATE}<<$txt\r\n"
if($defs{$dn} && $defs{$dn}{STATE}); if($defs{$dn} && $defs{$dn}{STATE});
} }
@ -2349,6 +2337,7 @@ FW_Notify($$)
my $ln = $ntfy->{NAME}; my $ln = $ntfy->{NAME};
my $dn = $dev->{NAME}; my $dn = $dev->{NAME};
my $data; my $data;
my %extPage;
my $rn = AttrVal($dn, "room", ""); my $rn = AttrVal($dn, "room", "");
if($filter eq "all" || $rn =~ m/\b$filter\b/) { if($filter eq "all" || $rn =~ m/\b$filter\b/) {
@ -2361,7 +2350,7 @@ FW_Notify($$)
$FW_ss = ($FW_sp =~ m/smallscreen/); $FW_ss = ($FW_sp =~ m/smallscreen/);
$FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/);
my ($allSet, $cmdlist, $txt) = FW_devState($dn, ""); my ($allSet, $cmdlist, $txt) = FW_devState($dn, "", \%extPage);
($FW_wname, $FW_ME, $FW_ss, $FW_tp, $FW_subdir) = @old; ($FW_wname, $FW_ME, $FW_ss, $FW_tp, $FW_subdir) = @old;
$data = "$dn<<$dev->{STATE}<<$txt\n"; $data = "$dn<<$dev->{STATE}<<$txt\n";
@ -2418,9 +2407,9 @@ FW_FlushInform($)
################### ###################
# Compute the state (==second) column # Compute the state (==second) column
sub sub
FW_devState($$) FW_devState($$@)
{ {
my ($d, $rf) = @_; my ($d, $rf, $extPage) = @_;
my ($hasOnOff, $link); my ($hasOnOff, $link);
@ -2487,6 +2476,19 @@ FW_devState($$)
} }
} }
my $type = $defs{$d}{TYPE};
my $sfn = $modules{$type}{FW_summaryFn};
if($sfn) {
if(!defined($extPage)) {
my %hash;
$extPage = \%hash;
}
no strict "refs";
$txt = &{$sfn}($FW_wname, $d, $FW_room, $extPage);
use strict "refs";
}
return ($allSets, $cmdList, $txt); return ($allSets, $cmdList, $txt);
} }