mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_DOIF.pm: new reading: warning, More information on warning in log
git-svn-id: https://svn.fhem.de/fhem/trunk@13703 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
afc6da9020
commit
5e5aa5a1a7
@ -59,7 +59,7 @@ DOIF_delAll($)
|
|||||||
#delete ($hash->{state});
|
#delete ($hash->{state});
|
||||||
#delete ($defs{$hash->{NAME}}{READINGS});
|
#delete ($defs{$hash->{NAME}}{READINGS});
|
||||||
foreach my $key (keys %{$defs{$hash->{NAME}}{READINGS}}) {
|
foreach my $key (keys %{$defs{$hash->{NAME}}{READINGS}}) {
|
||||||
delete $defs{$hash->{NAME}}{READINGS}{$key} if ($key =~ "^(Device|state|error|cmd|e_|timer_|wait_|matched_|last_cmd|mode)");
|
delete $defs{$hash->{NAME}}{READINGS}{$key} if ($key =~ "^(Device|state|error|warning|cmd|e_|timer_|wait_|matched_|last_cmd|mode)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1067,11 +1067,23 @@ DOIF_CheckCond($$)
|
|||||||
# $idx++;
|
# $idx++;
|
||||||
#}
|
#}
|
||||||
}
|
}
|
||||||
|
$cmdFromAnalyze="$hash->{NAME}: ".sprintf("warning in condition c%02d",($condition+1));
|
||||||
|
$lastWarningMsg="";
|
||||||
my $ret = eval $command;
|
my $ret = eval $command;
|
||||||
if($@){
|
if($@){
|
||||||
$err = "perl error in condition: $hash->{condition}{$condition}: $@";
|
$@ =~ s/^(.*) at \(eval.*\)(.*)$/$1,$2/;
|
||||||
|
$err = sprintf("condition c%02d",($condition+1)).": $@";
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
}
|
}
|
||||||
|
if ($lastWarningMsg) {
|
||||||
|
$lastWarningMsg =~ s/^(.*) at \(eval.*$/$1/;
|
||||||
|
readingsSingleUpdate ($hash, "warning", sprintf("condition c%02d",($condition+1)).": $lastWarningMsg",0);
|
||||||
|
} else {
|
||||||
|
delete ($defs{$hash->{NAME}}{READINGS}{warning});
|
||||||
|
}
|
||||||
|
$lastWarningMsg="";
|
||||||
|
$cmdFromAnalyze = undef;
|
||||||
|
|
||||||
return ($ret,$err);
|
return ($ret,$err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3384,6 +3396,10 @@ Hier passiert das nicht mehr, da die ursprünglichen Zustände cmd_1 und cmd_2 j
|
|||||||
<dt>wait_timer</dt>
|
<dt>wait_timer</dt>
|
||||||
<dd>Angabe des aktuellen Wait-Timers</dd>
|
<dd>Angabe des aktuellen Wait-Timers</dd>
|
||||||
</br>
|
</br>
|
||||||
|
<dt>warning</dt>
|
||||||
|
<dd>Perl-Warnung bei der Auswertung einer Bedingung</dd>
|
||||||
|
</br>
|
||||||
|
|
||||||
<a name="DOIF_Benutzerreadings"></a>
|
<a name="DOIF_Benutzerreadings"></a>
|
||||||
<dt><A-Z>_<readingname></dt>
|
<dt><A-Z>_<readingname></dt>
|
||||||
<dd>Readings, die mit einem Großbuchstaben und nachfolgendem Unterstrich beginnen, sind für User reserviert und werden auch zukünftig nicht vom Modul selbst benutzt.</dd>
|
<dd>Readings, die mit einem Großbuchstaben und nachfolgendem Unterstrich beginnen, sind für User reserviert und werden auch zukünftig nicht vom Modul selbst benutzt.</dd>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user