From 71623f47bc5ccf5b51389e789d7d106a38bc46a2 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 1 Apr 2013 11:19:27 +0000 Subject: [PATCH] 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 --- fhem/FHEM/90_at.pm | 4 ++-- fhem/FHEM/92_FileLog.pm | 2 +- fhem/docs/fhem.html | 2 +- fhem/fhem.pl | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index 6fa40c142..976114252 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -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; } diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index 3d571ccce..0ba7b32bc 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -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}; diff --git a/fhem/docs/fhem.html b/fhem/docs/fhem.html index 9d3f9ba02..d720b296b 100644 --- a/fhem/docs/fhem.html +++ b/fhem/docs/fhem.html @@ -192,7 +192,7 @@ to a X10 computer interface)
-
  • Some TV models from Samsung/Panasonic/LG) and amplifier (YAMAHA)
  • +
  • Some TV models from Samsung/Panasonic/LG and amplifier (YAMAHA)
  • More than one way to receive 1Wire sensor data or to switch 1wire actors. diff --git a/fhem/fhem.pl b/fhem/fhem.pl index eabd67c53..195000d29 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -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);