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/>.
#
#
# Version: 1.2.2
# Version: 1.2.3
#
# Major Version History:
# - 1.2.0 - 2014-03-12
@@ -1387,7 +1387,11 @@ sub PHTV_ReceiveCommand($$$) {
"PHTV $name: RCV TIMEOUT $service/" . urlDecode($cmd);
}
# device is not reachable or
# does not even support master command for audio
if ( $service eq "audio/volume" ) {
$newstate = "absent";
if (
( !defined( $hash->{helper}{AVAILABLE} ) )
or ( defined( $hash->{helper}{AVAILABLE} )
@@ -1399,6 +1403,21 @@ sub PHTV_ReceiveCommand($$$) {
}
}
# 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.";
}
}
}
# data received
elsif ($data) {
if (