YAMAHA_AVR: fixing presence detection

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6004 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch
2014-05-29 17:46:15 +00:00
parent c74464eb18
commit a948d3d656

View File

@@ -755,7 +755,7 @@ YAMAHA_AVR_ParseResponse ($$$)
my $cmd = $param->{cmd};
my $arg = $param->{arg};
$hash->{helper}{AVAILABLE} = ($err eq "" ? 1 : 0);
if($err ne "")
{
@@ -766,7 +766,9 @@ YAMAHA_AVR_ParseResponse ($$$)
Log3 $name, 3, "YAMAHA_AVR ($name) - could not execute command on device $name. Please turn on your device in case of deactivated network standby or check for correct hostaddress.";
readingsSingleUpdate($hash, "presence", "absent", 1);
readingsSingleUpdate($hash, "state", "absent", 1);
}
}
$hash->{helper}{AVAILABLE} = 0;
}
elsif($data ne "")
{
@@ -778,6 +780,8 @@ YAMAHA_AVR_ParseResponse ($$$)
readingsSingleUpdate($hash, "presence", "present", 1);
}
$hash->{helper}{AVAILABLE} = 1;
if(not $data =~ /RC="0"/)
{
# if the returncode isn't 0, than the command was not successful