2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

fhem.pl: fix userReadings difference + statistics problem (Forum #68061)

git-svn-id: https://svn.fhem.de/fhem/trunk@13537 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-02-27 12:34:57 +00:00
parent 4973a36162
commit 0e3122e427

View File

@ -4090,12 +4090,14 @@ readingsEndUpdate($$)
foreach my $userReading (@{$hash->{'.userReadings'}}) {
my $trigger = $userReading->{trigger};
my $reading= $userReading->{reading};
if(defined($trigger)) {
my @fnd = grep { $_ && $_ =~ m/^$trigger$/ } @{$hash->{CHANGED}};
next if(!@fnd);
my ($trRead, $ownRead);
map { $trRead = 1 if($_ && $_ =~ m/^$trigger$/);
$ownRead = 1 if($_ && $_ =~ m/^$reading:/); } @{$hash->{CHANGED}};
next if(!$trRead || $ownRead);
}
my $reading= $userReading->{reading};
my $modifier= $userReading->{modifier};
my $perlCode= $userReading->{perlCode};
my $oldvalue= $userReading->{value};