at: fix alignTime bug (forum#21792)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5319 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-03-25 10:11:47 +00:00
parent e0e971047d
commit 0efce1d35e

View File

@ -170,7 +170,8 @@ at_Attr(@)
return "startTimes: $name is not relative" if(!$rel); return "startTimes: $name is not relative" if(!$rel);
my (undef, $hr, $min, $sec, undef) = GetTimeSpec($tspec); my (undef, $hr, $min, $sec, undef) = GetTimeSpec($tspec);
my $alTime = ($alHr*60+$alMin)*60+$alSec; my $now = time();
my $alTime = ($alHr*60+$alMin)*60+$alSec-fhemTzOffset($now);
my $step = ($hr*60+$min)*60+$sec; my $step = ($hr*60+$min)*60+$sec;
my $ttime = int($hash->{TRIGGERTIME}); my $ttime = int($hash->{TRIGGERTIME});
my $off = ($ttime % 86400) - 86400; my $off = ($ttime % 86400) - 86400;
@ -178,7 +179,7 @@ at_Attr(@)
$off += $step; $off += $step;
} }
$ttime += ($alTime-$off); $ttime += ($alTime-$off);
$ttime += $step if($ttime < time()); $ttime += $step if($ttime < $now);
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
InternalTimer($ttime, "at_Exec", $hash, 0); InternalTimer($ttime, "at_Exec", $hash, 0);