From 3493a765ae226730f4a86b19e91a206bd041c436 Mon Sep 17 00:00:00 2001 From: dietmar63 Date: Thu, 10 Mar 2016 18:25:34 +0000 Subject: [PATCH] 98_Heating_Control, 98_WeekdayTimer: fix for https://forum.fhem.de/index.php/topic,50150.msg419471.html#msg419471 git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@11041 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_WeekdayTimer.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm index 8283bb440..da2237809 100644 --- a/fhem/FHEM/98_WeekdayTimer.pm +++ b/fhem/FHEM/98_WeekdayTimer.pm @@ -512,8 +512,9 @@ sub WeekdayTimer_SetTimerForMidnightUpdate($) { my $midnightPlus5Seconds = WeekdayTimer_zeitErmitteln ($now, 0, 0, 5, 1); #Log3 $hash, 3, "midnightPlus5Seconds------------>".FmtDateTime($midnightPlus5Seconds); - myRemoveInternalTimer("SetTimerOfDay", $hash); - myInternalTimer ("SetTimerOfDay", $midnightPlus5Seconds, "$hash->{TYPE}_SetTimerOfDay", $hash, 0); + myRemoveInternalTimer("SetTimerOfDay", $hash); + my $newMyHash = myInternalTimer ("SetTimerOfDay", $midnightPlus5Seconds, "$hash->{TYPE}_SetTimerOfDay", $hash, 0); + $newMyHash->{SETTIMERATMIDNIGHT} = 1; } ################################################################################ @@ -525,7 +526,7 @@ sub WeekdayTimer_SetTimerOfDay($) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); my $secSinceMidnight = 3600*$hour + 60*$min + $sec; - $hash->{SETTIMERATMIDNIGHT} = 1 if ($secSinceMidnight <= 10); + $hash->{SETTIMERATMIDNIGHT} = $myHash->{SETTIMERATMIDNIGHT}; WeekdayTimer_DeleteTimer($hash); WeekdayTimer_Profile ($hash); WeekdayTimer_SetTimer ($hash); @@ -944,7 +945,7 @@ sub WeekdayTimer_Device_Schalten($$$) { #Kommando ausführen if ($command && !$disabled && $activeTimer -# && $aktParam ne $newParam + && $aktParam ne $newParam ) { $newParam =~ s/:/ /g; @@ -1008,7 +1009,6 @@ sub WeekdayTimer_Attr($$$$) { readingsSingleUpdate ($hash, "disabled", $attrVal, 1); } elsif ( $attrName eq "switchInThePast" ) { $attr{$name}{$attrName} = $attrVal; -####$hash->{TYPE}_SetTimerOfDay({ HASH => $hash}); WeekdayTimer_SetTimerOfDay({ HASH => $hash}); } return undef;