mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Optimizing: get time once per event, and not for each FileLog definition once
git-svn-id: https://svn.fhem.de/fhem/trunk@3008 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a8e956a903
commit
71623f47bc
@ -58,7 +58,6 @@ at_Define($$)
|
||||
if($rel ne "+");
|
||||
$nt += ($hr*3600+$min*60+$sec); # Plus relative time
|
||||
$nt += SecondsTillTomorrow($ot) if($ot >= $nt); # Do it tomorrow...
|
||||
|
||||
@lt = localtime($nt);
|
||||
my $ntm = sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0]);
|
||||
if($rep) { # Setting the number of repetitions
|
||||
@ -76,7 +75,8 @@ at_Define($$)
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer($nt, "at_Exec", $hash, 0);
|
||||
|
||||
$hash->{STATE} = ($oldattr && $oldattr->{disable} ? "disabled" : ("Next: ".FmtTime($nt)));
|
||||
$hash->{STATE} = ($oldattr && $oldattr->{disable} ?
|
||||
"disabled" : ("Next: ".FmtTime($nt)));
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ FileLog_Log($$)
|
||||
my $n = $dev->{NAME};
|
||||
my $re = $log->{REGEXP};
|
||||
my $max = int(@{$dev->{CHANGED}});
|
||||
my $tn = TimeNow();
|
||||
my $tn = $dev->{TRIGGERTIME};
|
||||
my $ct = $dev->{CHANGETIME};
|
||||
my $wrotesome;
|
||||
my $fh = $log->{FH};
|
||||
|
@ -192,7 +192,7 @@
|
||||
to a X10 computer interface)</li>
|
||||
<div class="dist"></div>
|
||||
|
||||
<li>Some TV models from Samsung/Panasonic/LG) and amplifier (YAMAHA)</li>
|
||||
<li>Some TV models from Samsung/Panasonic/LG and amplifier (YAMAHA)</li>
|
||||
<div class="dist"></div>
|
||||
|
||||
<li>More than one way to receive 1Wire sensor data or to switch 1wire actors.
|
||||
|
@ -2352,6 +2352,7 @@ DoTrigger($$@)
|
||||
my @ntfyList = sort { $defs{$a}{NTFY_ORDER} cmp $defs{$b}{NTFY_ORDER} }
|
||||
grep { $defs{$_}{NTFY_ORDER} } keys %defs;
|
||||
Log 5, "Notify loop for $dev $hash->{CHANGED}->[0]";
|
||||
$hash->{TRIGGERTIME} = TimeNow(); # Optimize FileLog
|
||||
foreach my $n (@ntfyList) {
|
||||
next if(!defined($defs{$n})); # Was deleted in a previous notify
|
||||
my $r = CallFn($n, "NotifyFn", $defs{$n}, $hash);
|
||||
|
Loading…
Reference in New Issue
Block a user