From 418d376b0c60782d8a8e7ed1a86b2ed1bd676f46 Mon Sep 17 00:00:00 2001 From: markusbloch Date: Mon, 4 Jul 2016 20:30:50 +0000 Subject: [PATCH] PRESENCE: fix generating readings when definition is disabled (Forum: #55271) git-svn-id: https://svn.fhem.de/fhem/trunk@11739 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/73_PRESENCE.pm | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 2445f406c..4296d17cb 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: PRESENCE: fix generating readings when definition is disabled - changed: 49_SSCam: Workaround for problems with SVS version 7.2 concerning start recording and PTZ-actions, new attribute "showPassInLog" added, see commandref diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index 968e6c691..a29e2e35f 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -456,16 +456,19 @@ PRESENCE_Read($) DevIo_SimpleWrite($hash, $hash->{ADDRESS}."|".$hash->{TIMEOUT_PRESENT}."\n", 2); } - PRESENCE_ProcessState($hash, "present") unless($hash->{helper}{DISABLED}); + unless($hash->{helper}{DISABLED}) + { + PRESENCE_ProcessState($hash, "present"); - if($1 =~ /^(.*);(.+)$/) - { - readingsBulkUpdate($hash, "room", $2); - readingsBulkUpdate($hash, "device_name", $1); - } - else - { - readingsBulkUpdate($hash, "device_name", $1); + if($1 =~ /^(.*);(.+)$/) + { + readingsBulkUpdate($hash, "room", $2); + readingsBulkUpdate($hash, "device_name", $1); + } + else + { + readingsBulkUpdate($hash, "device_name", $1); + } } } elsif($line eq "command accepted")