mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
PHTV: fix for unsupported API commands
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5169 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
67659e2618
commit
072b51e00c
@ -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.1.2
|
# Version: 1.1.3
|
||||||
#
|
#
|
||||||
# Major Version History:
|
# Major Version History:
|
||||||
# - 1.1.0 - 2014-03-07
|
# - 1.1.0 - 2014-03-07
|
||||||
@ -1234,8 +1234,6 @@ sub PHTV_ReceiveCommand($$$) {
|
|||||||
# device not reachable
|
# device not reachable
|
||||||
if ($err) {
|
if ($err) {
|
||||||
|
|
||||||
$newstate = "absent";
|
|
||||||
|
|
||||||
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {
|
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {
|
||||||
Log3 $name, 4, "PHTV $name: RCV TIMEOUT $service";
|
Log3 $name, 4, "PHTV $name: RCV TIMEOUT $service";
|
||||||
}
|
}
|
||||||
@ -1244,6 +1242,11 @@ sub PHTV_ReceiveCommand($$$) {
|
|||||||
"PHTV $name: RCV TIMEOUT $service/" . urlDecode($cmd);
|
"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 (
|
if (
|
||||||
( !defined( $hash->{helper}{AVAILABLE} ) )
|
( !defined( $hash->{helper}{AVAILABLE} ) )
|
||||||
or ( defined( $hash->{helper}{AVAILABLE} )
|
or ( defined( $hash->{helper}{AVAILABLE} )
|
||||||
@ -1255,6 +1258,20 @@ sub PHTV_ReceiveCommand($$$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# device does not support command and behaves naughty
|
||||||
|
else {
|
||||||
|
$newstate = "on";
|
||||||
|
|
||||||
|
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
|
# data received
|
||||||
elsif ($data) {
|
elsif ($data) {
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user