From a7b488d7937b7bad24d32f4a9fe52091e87dd7be Mon Sep 17 00:00:00 2001 From: markusbloch Date: Fri, 26 Sep 2014 15:11:20 +0000 Subject: [PATCH] PRESENCE: try to fix flapping active state (Forum #27255) git-svn-id: https://svn.fhem.de/fhem/trunk@6621 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_PRESENCE.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index ec39599be..498149958 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -219,8 +219,9 @@ PRESENCE_Define($$) if($hash->{MODE} =~ /(lan-ping|local-bluetooth|fritzbox|shellscript|function)/) { + delete $hash->{helper}{RUNNING_PID} if(defined($hash->{helper}{RUNNING_PID})); RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+2, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED}); + InternalTimer(gettimeofday(), "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED}); return; } @@ -519,7 +520,7 @@ sub PRESENCE_StartLocalScan($;$) return; } - $hash->{STATE} = "active" if($hash->{STATE} eq "???" or "defined"); + $hash->{STATE} = "active" if($hash->{STATE} eq "???" or $hash->{STATE} eq "defined"); if($local == 0) {