mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 05:16:45 +00:00
98_DOIF.pm: warning inform. in log at eval, "deactivated" in status also in perl mode
git-svn-id: https://svn.fhem.de/fhem/trunk@22764 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2279aa7a69
commit
9224be7bc2
@ -281,9 +281,13 @@ sub DOIF_RegisterCell
|
|||||||
$err="'error $err: in expression: $expr'";
|
$err="'error $err: in expression: $expr'";
|
||||||
return $err;
|
return $err;
|
||||||
} else {
|
} else {
|
||||||
|
$lastWarningMsg="";
|
||||||
my ($exp,$sty,$wid,$com)=eval ($hash->{$table}{package}.$expr);
|
my ($exp,$sty,$wid,$com)=eval ($hash->{$table}{package}.$expr);
|
||||||
if ($@) {
|
return "'error $@ in expression: $expr'" if ($@);
|
||||||
return "'error $@ in expression: $expr'";
|
if ($lastWarningMsg) {
|
||||||
|
$lastWarningMsg =~ s/^(.*) at \(eval.*$/$1/;
|
||||||
|
Log3 ($hash->{NAME},3,"$hash->{NAME}:Warning in DOIF_RegisterCell:$hash->{$table}{package}.$expr");
|
||||||
|
$lastWarningMsg="";
|
||||||
}
|
}
|
||||||
if (defined $sty and $sty eq "" and defined $wid and $wid ne "") {
|
if (defined $sty and $sty eq "" and defined $wid and $wid ne "") {
|
||||||
if ($event) {
|
if ($event) {
|
||||||
@ -312,9 +316,12 @@ sub DOIF_RegisterCell
|
|||||||
$err="'error $err: in widget: $widget'";
|
$err="'error $err: in widget: $widget'";
|
||||||
return $err;
|
return $err;
|
||||||
} else {
|
} else {
|
||||||
|
$lastWarningMsg="";
|
||||||
eval ($widget);
|
eval ($widget);
|
||||||
if ($@) {
|
return "'error $@ in widget: $widget'" if ($@);
|
||||||
return "'error $@ in widget: $widget'";
|
if ($lastWarningMsg) {
|
||||||
|
Log3 ($hash->{NAME},3,"$hash->{NAME}:Warning in DOIF_RegisterCell:$widget");
|
||||||
|
$lastWarningMsg="";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -327,9 +334,12 @@ sub DOIF_RegisterCell
|
|||||||
$err="'error $err: in style: $style'";
|
$err="'error $err: in style: $style'";
|
||||||
return $err;
|
return $err;
|
||||||
} else {
|
} else {
|
||||||
|
$lastWarningMsg="";
|
||||||
eval $style;
|
eval $style;
|
||||||
if ($@) {
|
return "'error $@ in style: $style'" if ($@);
|
||||||
return "'error $@ in style: $style'";
|
if ($lastWarningMsg) {
|
||||||
|
Log3 ($hash->{NAME},3,"$hash->{NAME}:Warning in DOIF_RegisterCell:$style");
|
||||||
|
$lastWarningMsg="";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -688,7 +698,12 @@ sub DOIF_RegisterEvalAll
|
|||||||
for (my $l=0;$l < $lastcc;$l++){
|
for (my $l=0;$l < $lastcc;$l++){
|
||||||
for (my $m=0;$m < scalar keys %{$hash->{$table}{table}{$i}{$k}{$l}};$m++) {
|
for (my $m=0;$m < scalar keys %{$hash->{$table}{table}{$i}{$k}{$l}};$m++) {
|
||||||
if (defined $hash->{$table}{table}{$i}{$k}{$l}{$m}){
|
if (defined $hash->{$table}{table}{$i}{$k}{$l}{$m}){
|
||||||
|
$lastWarningMsg="";
|
||||||
my $value= eval($hash->{$table}{table}{$i}{$k}{$l}{$m});
|
my $value= eval($hash->{$table}{table}{$i}{$k}{$l}{$m});
|
||||||
|
if ($lastWarningMsg) {
|
||||||
|
Log3 ($hash->{NAME},3,"$hash->{NAME}:Warning in DOIF_RegisterEvalAll:$hash->{$table}{table}{$i}{$k}{$l}{$m}");
|
||||||
|
$lastWarningMsg="";
|
||||||
|
}
|
||||||
if (defined ($value)) {
|
if (defined ($value)) {
|
||||||
if (defined $defs{$value} and (!defined $hash->{$table}{shownodevicelink} or !$hash->{$table}{shownodevicelink})) {
|
if (defined $defs{$value} and (!defined $hash->{$table}{shownodevicelink} or !$hash->{$table}{shownodevicelink})) {
|
||||||
$ret.="<a href='$FW_ME?detail=$value$FW_CSRF'>$value</a>";
|
$ret.="<a href='$FW_ME?detail=$value$FW_CSRF'>$value</a>";
|
||||||
@ -3226,9 +3241,9 @@ CmdDoIfPerl($$)
|
|||||||
DOIF_delTimer($hash);
|
DOIF_delTimer($hash);
|
||||||
DOIF_delAll ($hash);
|
DOIF_delAll ($hash);
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
#readingsBulkUpdate($hash,"state","initialized");
|
|
||||||
readingsBulkUpdate ($hash,"mode","enabled");
|
readingsBulkUpdate ($hash,"mode","enabled");
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
readingsSingleUpdate($hash,"state","initialized",0);
|
||||||
$hash->{helper}{globalinit}=1;
|
$hash->{helper}{globalinit}=1;
|
||||||
#foreach my $key (keys %{$attr{$hash->{NAME}}}) {
|
#foreach my $key (keys %{$attr{$hash->{NAME}}}) {
|
||||||
# if ($key ne "disable" and AttrVal($hash->{NAME},$key,"")) {
|
# if ($key ne "disable" and AttrVal($hash->{NAME},$key,"")) {
|
||||||
@ -3534,9 +3549,10 @@ DOIF_Attr(@)
|
|||||||
DOIF_delTimer($hash);
|
DOIF_delTimer($hash);
|
||||||
DOIF_delAll ($hash);
|
DOIF_delAll ($hash);
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
if ($hash->{MODEL} ne "Perl") {
|
#if ($hash->{MODEL} ne "Perl") {
|
||||||
|
# readingsBulkUpdate ($hash, "state", "deactivated");
|
||||||
|
#}
|
||||||
readingsBulkUpdate ($hash, "state", "deactivated");
|
readingsBulkUpdate ($hash, "state", "deactivated");
|
||||||
}
|
|
||||||
readingsBulkUpdate ($hash, "mode", "deactivated");
|
readingsBulkUpdate ($hash, "mode", "deactivated");
|
||||||
readingsEndUpdate ($hash, 1);
|
readingsEndUpdate ($hash, 1);
|
||||||
} elsif($a[0] eq "set" && $a[2] eq "state") {
|
} elsif($a[0] eq "set" && $a[2] eq "state") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user