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