mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 09:55:38 +00:00
98_DOIF.pm: fixed empty reading in the aggregation function
git-svn-id: https://svn.fhem.de/fhem/trunk@26440 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e42907694c
commit
2d5868c7df
@ -961,7 +961,9 @@ sub AggrIntDoIf
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $reading) {
|
||||
$reading = "" if (!defined $reading);
|
||||
|
||||
if ($reading ne "") {
|
||||
if ($reading =~ /^"(.*)"$/) {
|
||||
$readingRegex = $1;
|
||||
}
|
||||
@ -972,7 +974,7 @@ sub AggrIntDoIf
|
||||
foreach my $reading ((defined $readingRegex) ? grep {/$readingRegex/} keys %{$defs{$name}{READINGS}} : $reading) {
|
||||
$value="";
|
||||
$number="";
|
||||
if (defined($reading)) {
|
||||
if ($reading ne "") {
|
||||
if (defined $defs{$name}{READINGS}{$reading}) {
|
||||
$value=$defs{$name}{READINGS}{$reading}{VAL};
|
||||
$number = ($value =~ /(-?\d+(\.\d+)?)/ ? $1 : 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user