mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
YAMAHA_AVR: fixing presence detection
git-svn-id: https://svn.fhem.de/fhem/trunk@6004 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2a5a840578
commit
e630f0637e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user