From 4262537e11a4a5f92f60ef914ad927877e7a0404 Mon Sep 17 00:00:00 2001 From: jowiemann <> Date: Thu, 1 Feb 2024 12:55:10 +0000 Subject: [PATCH] 73_PRESENCE.pm: inactive git-svn-id: https://svn.fhem.de/fhem/trunk@28456 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_PRESENCE.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index a2ad2adc3..b9d878a6f 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -1,4 +1,4 @@ -# $Id$ +# $Id$ ############################################################################## # # 73_PRESENCE.pm @@ -42,6 +42,7 @@ PRESENCE_Initialize($) $hash->{ReadFn} = "PRESENCE_Read"; $hash->{ReadyFn} = "PRESENCE_Ready"; $hash->{SetFn} = "PRESENCE_Set"; + $hash->{StateFn} = "PRESENCE_State"; $hash->{DefFn} = "PRESENCE_Define"; $hash->{NotifyFn} = "PRESENCE_Notify"; $hash->{UndefFn} = "PRESENCE_Undef"; @@ -264,6 +265,20 @@ PRESENCE_Undef($$) return undef; } +##################################### +sub +PRESENCE_State($$$$) +{ + my ($hash, $tim, $vt, $val) = @_; + + $hash->{STATE} = $val if($vt eq "STATE" && !$init_done); + + return undef if($vt ne "state" || $val ne "disabled"); + $hash->{helper}{DISABLED} = 1; + readingsSingleUpdate($hash, "state", "disabled", 1); + return undef; +} + ##################################### sub PRESENCE_Notify($$)