From d28138de366397dd6e2ea7c954758711320d5c99 Mon Sep 17 00:00:00 2001 From: markusbloch Date: Sat, 20 Dec 2014 17:30:27 +0000 Subject: [PATCH] PRESENCE: fixing not working timer, when using set [...] statusRequest (additionally to r7184, thanks to Patrick) git-svn-id: https://svn.fhem.de/fhem/trunk@7278 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_PRESENCE.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index 98c012f2b..11df26c09 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -552,6 +552,18 @@ sub PRESENCE_StartLocalScan($;$) } else { + Log3 $hash->{NAME}, 4, "PRESENCE ($name) - another check is currently running. skipping check"; + + if($local == 0) + { + my $seconds = (ReadingsVal($name, "state", "absent") eq "present" ? $hash->{TIMEOUT_PRESENT} : $hash->{TIMEOUT_NORMAL}); + + Log3 $hash->{NAME}, 4, "PRESENCE ($name) - rescheduling next check in $seconds seconds"; + + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$seconds, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED}); + } + return "another check is currently running"; } }