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

98:DOIF.pm

kein Eval im Ausführungsteil bei Definition eines Moduls, no Timer wird jetzt korrekt gesetzt

git-svn-id: https://svn.fhem.de/fhem/trunk@8031 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
damian-s 2015-02-18 17:49:10 +00:00
parent 569bf61195
commit e8d9cb6785

View File

@ -127,9 +127,10 @@ sub
ReadingValDoIf($$$)
{
my ($name,$reading,$regExp)=@_;
my $r="";
my $r;
my $element;
$r=$defs{$name}{READINGS}{$reading}{VAL};
$r="" if (!defined($r));
if ($regExp) {
$element = ($r =~ /$regExp/) ? $1 : "";
} else {
@ -307,8 +308,10 @@ ParseCommandsDoIf($$$)
if ($currentBlock ne "") {
($currentBlock,$err)=ReplaceAllReadingsDoIf($hash,$currentBlock,-1,$eval);
return ($currentBlock,$err) if ($err);
($currentBlock,$err)=EvalAllDoIf($currentBlock);
return ($currentBlock,$err) if ($err);
if ($eval) {
($currentBlock,$err)=EvalAllDoIf($currentBlock);
return ($currentBlock,$err) if ($err);
}
}
$currentBlock="{".$currentBlock."}";
} elsif ($tailBlock =~ /^\s*IF/) {
@ -341,8 +344,10 @@ ParseCommandsDoIf($$$)
if ($currentBlock ne "") {
($currentBlock,$err)=ReplaceAllReadingsDoIf($hash,$currentBlock,-1,$eval);
return ($currentBlock,$err) if ($err);
($currentBlock,$err)=EvalAllDoIf($currentBlock);
return ($currentBlock,$err) if ($err);
if ($eval) {
($currentBlock,$err)=EvalAllDoIf($currentBlock);
return ($currentBlock,$err) if ($err);
}
}
}
if ($eval) {
@ -825,11 +830,10 @@ DOIF_SleepTrigger ($)
{
my ($hash)=@_;
$hash->{helper}{sleeptimer}=-1;
readingsSingleUpdate ($hash, "wait_timer", "no timer",1);
if (!AttrVal($hash->{NAME},"disable","")) {
DOIF_Trigger($hash,$hash->{helper}{sleepdevice},-2);
}
#delete ($defs{$hash->{NAME}}{READINGS}{wait_timer});
readingsSingleUpdate ($hash, "wait_timer", "no timer",1);
return undef;
}