From 390fcbeb378a04a12e54f9faf3410d27739fda3e Mon Sep 17 00:00:00 2001 From: Byte09 <> Date: Fri, 5 Oct 2018 03:46:12 +0000 Subject: [PATCH] 98_MSwitch.pm:fix timer git-svn-id: https://svn.fhem.de/fhem/trunk@17459 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_MSwitch.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/98_MSwitch.pm b/fhem/FHEM/98_MSwitch.pm index c2da9529d..e7bf5dff4 100644 --- a/fhem/FHEM/98_MSwitch.pm +++ b/fhem/FHEM/98_MSwitch.pm @@ -5961,19 +5961,19 @@ sub MSwitch_Createtimer($) { my $Name = $hash->{NAME}; - MSwitch_LOG( $Name, 5,"create timer"); + # keine timer vorhenden my $condition = ReadingsVal( $Name, '.Trigger_time', '' ); - + #MSwitch_LOG( $Name, 0,"create timer: ".$condition); $condition =~ s/#\[dp\]/:/g; my $x =0; # (.*)\[(.*[a-zA-Z].*)\:(.*)\](.*) - #while ( $condition =~ m/(.*)\[(.*[^0-9]{2})\:(.*[^0-9]{2})\](.*)/ ) - while ( $condition =~ m/(.*)\[(.*[a-zA-Z].*)\:(.*)\](.*)/ ) + while ( $condition =~ m/(.*)\[(.*[^0-9]{2})\:(.*[^0-9]{2})\](.*)/ ) + #while ( $condition =~ m/(.*)\[(.*[a-zA-Z].*)\:(.*)\](.*)/ ) { $x++; # notausstieg notausstieg last if $x > 20; # notausstieg notausstieg @@ -5983,6 +5983,10 @@ sub MSwitch_Createtimer($) { my $lenght = length($condition); + + #MSwitch_LOG( $Name, 0,"create timer: ".$condition); + + #remove all timers MSwitch_Clear_timer($hash); @@ -6021,10 +6025,10 @@ sub MSwitch_Createtimer($) { $timer[2] = '' if ( !defined $timer[2] ); $timer[3] = '' if ( !defined $timer[3] ); - MSwitch_LOG( $Name, 5,"timer0 $timer[0]"); - MSwitch_LOG( $Name, 5,"timer1 $timer[1]"); - MSwitch_LOG( $Name, 5,"timer2 $timer[2]"); - MSwitch_LOG( $Name, 5,"timer3 $timer[3]"); + MSwitch_LOG( $Name, 0,"timer0 $timer[0]"); + MSwitch_LOG( $Name, 0,"timer1 $timer[1]"); + MSwitch_LOG( $Name, 0,"timer2 $timer[2]"); + MSwitch_LOG( $Name, 0,"timer3 $timer[3]"); # lösche bei notify und toggle