2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-28 17:12:32 +00:00

Bugfix: Error message in inform when multi-channel hm device is created

git-svn-id: https://svn.fhem.de/fhem/trunk@1177 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-01-07 09:00:32 +00:00
parent 6eff8e72e1
commit c6b1084158

View File

@ -2124,21 +2124,23 @@ DoTrigger($$)
################ ################
# Inform # Inform
$max = int(@{$defs{$dev}{CHANGED}}); # can be enriched in the notifies if($defs{$dev}{CHANGED}) { # It gets deleted sometimes (?)
foreach my $c (keys %client) { # Do client loop first, is cheaper $max = int(@{$defs{$dev}{CHANGED}}); # can be enriched in the notifies
next if(!$client{$c}{inform} || $client{$c}{inform} eq "raw"); foreach my $c (keys %client) { # Do client loop first, is cheaper
my $tn = TimeNow(); next if(!$client{$c}{inform} || $client{$c}{inform} eq "raw");
if($attr{global}{mseclog}) { my $tn = TimeNow();
my ($seconds, $microseconds) = gettimeofday(); if($attr{global}{mseclog}) {
$tn .= sprintf(".%03d", $microseconds/1000); my ($seconds, $microseconds) = gettimeofday();
} $tn .= sprintf(".%03d", $microseconds/1000);
my $re = $client{$c}{informRegexp}; }
for(my $i = 0; $i < $max; $i++) { my $re = $client{$c}{informRegexp};
my $state = $defs{$dev}{CHANGED}[$i]; for(my $i = 0; $i < $max; $i++) {
next if($re && $state !~ m/$re/); my $state = $defs{$dev}{CHANGED}[$i];
syswrite($client{$c}{fd}, next if($re && $state !~ m/$re/);
($client{$c}{inform} eq "timer" ? "$tn " : "") . syswrite($client{$c}{fd},
"$defs{$dev}{TYPE} $dev $state\n"); ($client{$c}{inform} eq "timer" ? "$tn " : "") .
"$defs{$dev}{TYPE} $dev $state\n");
}
} }
} }