fixing dead PRESENCE devices in case of a broken network connection when disabled

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2720 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch
2013-02-13 22:02:53 +00:00
parent ccd9416679
commit 3c770b30d6

View File

@@ -196,9 +196,16 @@ PRESENCE_Attr(@)
if($a[3] eq "0")
{
$hash->{helper}{DISABLED} = 0;
if(defined($hash->{FD}))
if(defined($hash->{DeviceName}))
{
PRESENCE_DoInit($hash);
if(defined($hash->{FD}))
{
PRESENCE_DoInit($hash);
}
else
{
DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
}
}
else
{
@@ -223,9 +230,16 @@ PRESENCE_Attr(@)
elsif($a[0] eq "del" && $a[2] eq "disable")
{
$hash->{helper}{DISABLED} = 0;
if(defined($hash->{FD}))
if(defined($hash->{DeviceName}))
{
PRESENCE_DoInit($hash);
if(defined($hash->{FD}))
{
PRESENCE_DoInit($hash);
}
else
{
DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
}
}
else
{