PHTV: fix supportedAPIcmds detection

git-svn-id: https://svn.fhem.de/fhem/trunk@5305 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
loredo
2014-03-23 13:16:17 +00:00
parent 38fbc54320
commit 72cffe7de5

View File

@@ -24,7 +24,7 @@
# along with fhem. If not, see <http://www.gnu.org/licenses/>. # along with fhem. If not, see <http://www.gnu.org/licenses/>.
# #
# #
# Version: 1.2.2 # Version: 1.2.3
# #
# Major Version History: # Major Version History:
# - 1.2.0 - 2014-03-12 # - 1.2.0 - 2014-03-12
@@ -1387,15 +1387,34 @@ sub PHTV_ReceiveCommand($$$) {
"PHTV $name: RCV TIMEOUT $service/" . urlDecode($cmd); "PHTV $name: RCV TIMEOUT $service/" . urlDecode($cmd);
} }
$newstate = "absent"; # device is not reachable or
if ( # does not even support master command for audio
( !defined( $hash->{helper}{AVAILABLE} ) ) if ( $service eq "audio/volume" ) {
or ( defined( $hash->{helper}{AVAILABLE} ) $newstate = "absent";
and $hash->{helper}{AVAILABLE} eq 1 )
) if (
{ ( !defined( $hash->{helper}{AVAILABLE} ) )
$hash->{helper}{AVAILABLE} = 0; or ( defined( $hash->{helper}{AVAILABLE} )
readingsBulkUpdate( $hash, "presence", "absent" ); and $hash->{helper}{AVAILABLE} eq 1 )
)
{
$hash->{helper}{AVAILABLE} = 0;
readingsBulkUpdate( $hash, "presence", "absent" );
}
}
# device behaves naughty
else {
$newstate = "on";
# because it does not seem to support the command
if ( !defined( $hash->{helper}{supportedAPIcmds}{$service} ) ) {
$hash->{helper}{supportedAPIcmds}{$service} = 0;
Log3 $name, 3,
"PHTV $name: API command '"
. $service
. "' not supported by device.";
}
} }
} }