From 36b9cdbc696a833500f3a350ed2dfcf5912b466c Mon Sep 17 00:00:00 2001 From: dietmar63 <> Date: Sat, 9 Jan 2016 18:33:25 +0000 Subject: [PATCH] 98_WeekdayTimer, 98_Heating_Control: issue http://forum.fhem.de/index.php/topic,46312.0.html fixed. no crash anymore when using a wrong definition name git-svn-id: https://svn.fhem.de/fhem/trunk@10430 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_WeekdayTimer.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm index 7c50a57df..3b638c281 100644 --- a/fhem/FHEM/98_WeekdayTimer.pm +++ b/fhem/FHEM/98_WeekdayTimer.pm @@ -140,8 +140,7 @@ sub WeekdayTimer_Define($$) { $hash->{helper}{daysRegExp} =~ s/\!/\\\!/g; WeekdayTimer_GlobalDaylistSpec ($hash, \@a); - - $hash->{TYPE} = $type; + $hash->{NAME} = $name; $hash->{DEVICE} = $device; @@ -416,11 +415,11 @@ sub WeekdayTimer_gatherSwitchingTimes { #pruefen auf Angabe eines Schaltpunktes my $element = ""; - my @restoreElemets = (); + my @restoreElements = (); E: while (@$a > 0) { my $actualElement = shift @$a; - push @restoreElemets, $actualElement; + push @restoreElements, $actualElement; $element = $element . $actualElement . " "; Log3 $hash, 5, "[$name] $element - trying to accept as a switchtime"; @@ -447,6 +446,8 @@ E: while (@$a > 0) { last; } + # ein space am Ende wieder abschneiden + $element = substr ($element, 0, length($element)-1); my @t = split(/\|/, $element); my $anzahl = @t; if ( $anzahl >= 2 && $anzahl <= 3) { @@ -454,7 +455,7 @@ E: while (@$a > 0) { push(@switchingtimes, $element); } else { Log3 $hash, 4, "[$name] $element - NOT accepted, must be command or condition"; - unshift @$a, @restoreElemets; + unshift @$a, @restoreElements; last; } }