From 5e4d7e8c148c35b9319fdea3d78f00f42b8af3e3 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Thu, 9 Jul 2020 18:12:29 +0000 Subject: [PATCH] 98_WeekdayTimer.pm: prevent reboot loop in case of open window and changed weekprofile, forum #112751 git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22373 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_WeekdayTimer.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FHEM/98_WeekdayTimer.pm b/FHEM/98_WeekdayTimer.pm index cdab73c1f..e4cfc7613 100644 --- a/FHEM/98_WeekdayTimer.pm +++ b/FHEM/98_WeekdayTimer.pm @@ -86,6 +86,8 @@ sub WeekdayTimer_Undef { for my $idx (keys %{$hash->{profil}}) { WeekdayTimer_RemoveInternalTimer($idx, $hash); } + WeekdayTimer_RemoveInternalTimer($hash->{VERZOEGRUNG_IDX},$hash) if defined ($hash->{VERZOEGRUNG_IDX}); + delete $modules{$hash->{TYPE}}{defptr}{$hash->{NAME}}; return WeekdayTimer_RemoveInternalTimer("SetTimerOfDay", $hash); } @@ -95,11 +97,14 @@ sub WeekdayTimer_Start { my $hash = shift // return; my $name = $hash->{NAME}; my $def = $hash->{DEF}; - + WeekdayTimer_RemoveInternalTimer($hash->{VERZOEGRUNG_IDX},$hash) if defined ($hash->{VERZOEGRUNG_IDX}); my @arr = split m{\s+}xms, $def; my $device = shift @arr; my $language = WeekdayTimer_Language ($hash, \@arr); + + $hash->{CONDITION} = ""; + $hash->{COMMAND} = ""; my $idx = 0; $hash->{'.dayNumber'} = {map {$_ => $idx++} @{$hash->{'.shortDays'}{$language}}}; @@ -127,8 +132,6 @@ sub WeekdayTimer_Start { $modules{$hash->{TYPE}}{defptr}{$hash->{NAME}} = $hash; - $hash->{CONDITION} = ""; - $hash->{COMMAND} = ""; if($conditionOrCommand =~ m{\A\(.*\)\z}xms) { #condition (*) $hash->{CONDITION} = $conditionOrCommand; } elsif(length($conditionOrCommand) > 0 ) {