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
This commit is contained in:
markusbloch
2016-07-04 20:30:50 +00:00
parent 848461d701
commit 418d376b0c
2 changed files with 13 additions and 9 deletions

View File

@@ -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

View File

@@ -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")