From a86d1bfcdf41173aad53429d380bc4afc573d74c Mon Sep 17 00:00:00 2001
From: damian-s <>
Date: Tue, 11 Nov 2014 17:37:24 +0000
Subject: [PATCH] 98_DOIF.pm: fixed 0 in Time
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6948 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
FHEM/98_DOIF.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/FHEM/98_DOIF.pm b/FHEM/98_DOIF.pm
index 0ecf631f6..7ee4c49c5 100644
--- a/FHEM/98_DOIF.pm
+++ b/FHEM/98_DOIF.pm
@@ -343,7 +343,7 @@ DOIF_CheckTimers($$$$)
$nrs[$i++]=$nr;
$timer=substr($timer,pos($timer)) if ($timer =~ /^\s*\-/g);
}
- $days = "" if (!$days);
+ $days = "" if (!defined ($days));
for (my $j=0; $j<$i;$j++) {
$nr=$nrs[$j];
$time=$times[$j];
@@ -351,7 +351,7 @@ DOIF_CheckTimers($$$$)
$hash->{timer}{$nr}=0;
$hash->{time}{$nr}=$time;
$hash->{timeCond}{$nr}=$condition;
- $hash->{days}{$nr}=$days if ($days);
+ $hash->{days}{$nr}=$days if ($days ne "");
${$timerarray}[$nr]={hash=>$hash,nr=>$nr};
$err=(DOIF_SetTimer("DOIF_TimerTrigger",\${$timerarray}[$nr]));
return($hash->{time}{$nr},$err) if ($err);
@@ -388,7 +388,7 @@ DOIF_time($$$$$)
}
}
if ($ret == 1) {
- return 1 if (!$days or $days =~ /$wday/ or ($days =~ /7/ and $we) or ($days =~ /8/ and !$we));
+ return 1 if ($days eq "" or $days =~ /$wday/ or ($days =~ /7/ and $we) or ($days =~ /8/ and !$we));
}
return 0;
}
@@ -400,7 +400,7 @@ DOIF_time_once($$$)
my ($flag,$wday,$days)=@_;
my $we=DOIF_we($wday);
if ($flag) {
- return 1 if (!$days or $days =~ /$wday/ or ($days =~ /7/ and $we) or ($days =~ /8/ and !$we));
+ return 1 if ($days eq "" or $days =~ /$wday/ or ($days =~ /7/ and $we) or ($days =~ /8/ and !$we));
}
return 0;
}
@@ -653,7 +653,7 @@ DOIF_SetTimer($$)
}
}
my $next_time_str=strftime("%d.%m.%Y %H:%M:%S",localtime($next_time));
- $next_time_str.="\|".$hash->{days}{$nr} if ($hash->{days}{$nr});
+ $next_time_str.="\|".$hash->{days}{$nr} if (defined ($hash->{days}{$nr}));
readingsSingleUpdate ($hash,"timer_".($nr+1)."_c".($cond+1),$next_time_str,0);
$hash->{realtime}{$nr}=strftime("%H:%M:%S",localtime($next_time));
RemoveInternalTimer($timer);
@@ -1164,7 +1164,7 @@ Wenn nur der DOIF-Fall angegeben wird, so wird, wenn Bedingung nicht erfüllt is
Reine Statusanzeige ohne Ausführung von Befehlen. Der Ausführungsteil kann jeweils ausgelassen werden:
-define di_humiditystate DOIF ([outdoor:humidity]>70) DOELSEIF ([outdoor:humidity]>50) DOELSE
+define di_hum DOIF ([outdoor:humidity]>70) DOELSEIF ([outdoor:humidity]>50) DOELSE
attr di_hum cmdState wet|normal|dry
Anpassung des Status mit Hilfe des Attributes "state". Es können beliebige Reading und Stati oder Internals angegeben werden: