2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

71_LISTENLIVE - Changed - Make presence TEMPORARY

git-svn-id: https://svn.fhem.de/fhem/trunk@5071 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-02-28 09:53:37 +00:00
parent b272c4fe7d
commit a1e458ea0a

View File

@ -74,6 +74,9 @@
# Added: ShutdownFn
# Changed: Undef will delete presence, too
#
# 2014-02-28
# Changed: Make presence entities TEMPORARY
#
##############################################################################
package main;
@ -196,15 +199,18 @@ sub LISTENLIVE_Define($$) {
if($address[0] ne "none"){
# PRESENCE aus device pres_+NAME lesen
my $pres_name;
$presence = ReadingsVal("pres_".$name,"state","noPresence");
if($presence eq "noPresence"){
$cmd = "pres_$name PRESENCE lan-ping $address[0]";
$pres_name = "pres_".$name;
$cmd = "$pres_name PRESENCE lan-ping $address[0]";
$ret = CommandDefine(undef, $cmd);
if($ret){
Log3($name, 2, "LISTENLIVE ERROR $ret");
} else {
Log3($name, 3, "LISTENLIVE $name PRESENCE pres_$name created.");
Log3($name, 3, "LISTENLIVE $name PRESENCE $pres_name created.");
$defs{$pres_name}{TEMPORARY} = 1;
}
} else {
Log3($name, 3, "LISTENLIVE $name PRESENCE pres_$name found.");