mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
at drift fixed
git-svn-id: https://svn.fhem.de/fhem/trunk@308 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4205850e95
commit
e7dd568030
@ -469,3 +469,4 @@
|
||||
- =DATE= (4.6)
|
||||
- bugfix: fht actuator message clarification by Klaus
|
||||
- feature: getstate command from Martin (25.12)
|
||||
- bugfix: at drifts for relative timespecs
|
||||
|
@ -368,7 +368,7 @@ FHT_Parse($$)
|
||||
if($sval =~ m/.0/) { $val = "syncnow" }
|
||||
elsif($sval =~ m/.1/) { $val = "99%" } # FHT set to 30.5, FHT80B=="ON"
|
||||
elsif($sval =~ m/.2/) { $val = "0%" } # FHT set to 5.5
|
||||
elsef($sval =~ m/.6/) { $val = "$fv" }
|
||||
elsif($sval =~ m/.6/) { $val = "$fv" }
|
||||
elsif($sval =~ m/.8/) { $val = "offset: $fv" }
|
||||
elsif($sval =~ m/.a/) { $val = "lime-protection" }
|
||||
elsif($sval =~ m/.c/) { $val = "synctime" }
|
||||
|
@ -18,6 +18,8 @@ at_Initialize($)
|
||||
}
|
||||
|
||||
|
||||
my $at_tdiff;
|
||||
|
||||
#####################################
|
||||
sub
|
||||
at_Define($$)
|
||||
@ -52,6 +54,7 @@ at_Define($$)
|
||||
if($rel ne "+");
|
||||
$nt += ($hr*3600+$min*60+$sec); # Plus relative time
|
||||
$nt += 86400 if($ot >= $nt);# Do it tomorrow...
|
||||
$nt += $at_tdiff if(defined($at_tdiff));
|
||||
|
||||
@lt = localtime($nt);
|
||||
my $ntm = sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0]);
|
||||
@ -106,6 +109,9 @@ at_Exec($)
|
||||
my $def = $defs{$name}{DEF};
|
||||
|
||||
my $oldattr = $attr{$name}; # delete removes the attributes too
|
||||
|
||||
# Correct drift when the timespec is relative
|
||||
$at_tdiff = $defs{$name}{TRIGGERTIME}-gettimeofday() if($def =~ m/^\+/);
|
||||
CommandDelete(undef, $name); # Recreate ourselves
|
||||
|
||||
if($count) {
|
||||
@ -113,6 +119,7 @@ at_Exec($)
|
||||
CommandDefine(undef, "$name at $def"); # Recompute the next TRIGGERTIME
|
||||
$attr{$name} = $oldattr;
|
||||
}
|
||||
$at_tdiff = undef;
|
||||
}
|
||||
|
||||
sub
|
||||
|
Loading…
Reference in New Issue
Block a user