mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +00:00
70_PIONEERAVR: Screen* readings get regular updates (for network input)
git-svn-id: https://svn.fhem.de/fhem/trunk@14584 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9284c5601f
commit
e89556caa0
@ -114,7 +114,7 @@ sub PIONEERAVR_Initialize($) {
|
|||||||
volumeLimitStraight
|
volumeLimitStraight
|
||||||
disable:0,1
|
disable:0,1
|
||||||
connectionCheck:off,30,45,60,75,90,105,120
|
connectionCheck:off,30,45,60,75,90,105,120
|
||||||
timeout:1,2,3,4,5
|
timeout:1,2,3,4,5,7,10,15
|
||||||
);
|
);
|
||||||
use warnings 'qw';
|
use warnings 'qw';
|
||||||
$hash->{AttrList} = join( " ", @attrList ) . " " . $readingFnAttributes;
|
$hash->{AttrList} = join( " ", @attrList ) . " " . $readingFnAttributes;
|
||||||
@ -155,232 +155,238 @@ sub PIONEERAVR_Initialize($) {
|
|||||||
sub PIONEERAVR_Define($$) {
|
sub PIONEERAVR_Define($$) {
|
||||||
my ( $hash, $a, $h ) = @_;
|
my ( $hash, $a, $h ) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
# my $infix = "PIONEERAVR";
|
|
||||||
|
|
||||||
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
||||||
|
|
||||||
|
my $protocol = @$a[2];
|
||||||
|
|
||||||
# my ( $hash, $def) = @_;
|
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
||||||
# my @a = split("[ \t]+", $def);
|
|
||||||
# my $name = $hash->{NAME};
|
|
||||||
my $protocol = @$a[2];
|
|
||||||
|
|
||||||
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
if( int(@$a) != 4 || (($protocol ne "telnet") && ($protocol ne "serial"))) {
|
||||||
|
my $msg = "Wrong syntax: define <name> PIONEERAVR telnet <ipaddress[:port]> or define <name> PIONEERAVR serial <devicename[\@baudrate]>";
|
||||||
|
Log3 $name, 3, "PIONEERAVR $name: " . $msg;
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
|
|
||||||
if( int(@$a) != 4 || (($protocol ne "telnet") && ($protocol ne "serial"))) {
|
RemoveInternalTimer( $hash);
|
||||||
my $msg = "Wrong syntax: define <name> PIONEERAVR telnet <ipaddress[:port]> or define <name> PIONEERAVR serial <devicename[\@baudrate]>";
|
DevIo_CloseDev( $hash);
|
||||||
Log3 $name, 3, "PIONEERAVR $name: " . $msg;
|
delete $hash->{NEXT_OPEN} if ( defined( $hash->{NEXT_OPEN} ) );
|
||||||
return $msg;
|
|
||||||
}
|
|
||||||
# $hash->{TYPE} = "PIONEERAVR";
|
|
||||||
|
|
||||||
RemoveInternalTimer( $hash);
|
# set default attributes
|
||||||
DevIo_CloseDev( $hash);
|
if ( $init_done && !defined( $hash->{OLDDEF} ) ) {
|
||||||
delete $hash->{NEXT_OPEN} if ( defined( $hash->{NEXT_OPEN} ) );
|
fhem 'attr ' . $name . ' stateFormat stateAV';
|
||||||
|
fhem 'attr ' . $name
|
||||||
|
. ' cmdIcon muteT:rc_MUTE previous:rc_PREVIOUS next:rc_NEXT play:rc_PLAY pause:rc_PAUSE stop:rc_STOP shuffleT:rc_SHUFFLE repeatT:rc_REPEAT';
|
||||||
|
fhem 'attr ' . $name . ' webCmd volume:mute:input';
|
||||||
|
fhem 'attr ' . $name
|
||||||
|
. ' devStateIcon on:rc_GREEN@green:off off:rc_STOP:on absent:rc_RED:reopen playing:rc_PLAY@green:pause paused:rc_PAUSE@green:play muted:rc_MUTE@green:muteT fast-rewind:rc_REW@green:play fast-forward:rc_FF@green:play interrupted:rc_PAUSE@yellow:play';
|
||||||
|
}
|
||||||
|
|
||||||
# set default attributes
|
# $hash->{DeviceName} is needed for DevIo_OpenDev()
|
||||||
if ( $init_done && !defined( $hash->{OLDDEF} ) ) {
|
$hash->{Protocol}= $protocol;
|
||||||
fhem 'attr ' . $name . ' stateFormat stateAV';
|
my $devicename= @$a[3];
|
||||||
fhem 'attr ' . $name
|
$hash->{DeviceName} = $devicename;
|
||||||
. ' cmdIcon muteT:rc_MUTE previous:rc_PREVIOUS next:rc_NEXT play:rc_PLAY pause:rc_PAUSE stop:rc_STOP shuffleT:rc_SHUFFLE repeatT:rc_REPEAT';
|
|
||||||
fhem 'attr ' . $name . ' webCmd volume:mute:input';
|
|
||||||
fhem 'attr ' . $name
|
|
||||||
. ' devStateIcon on:rc_GREEN@green:off off:rc_STOP:on absent:rc_RED:reopen playing:rc_PLAY@green:pause paused:rc_PAUSE@green:play muted:rc_MUTE@green:muteT fast-rewind:rc_REW@green:play fast-forward:rc_FF@green:play interrupted:rc_PAUSE@yellow:play';
|
|
||||||
}
|
|
||||||
|
|
||||||
# $hash->{DeviceName} is needed for DevIo_OpenDev()
|
# connect using serial connection (old blocking style)
|
||||||
$hash->{Protocol}= $protocol;
|
if ( $hash->{Protocol} eq "serial" )
|
||||||
my $devicename= @$a[3];
|
{
|
||||||
$hash->{DeviceName} = $devicename;
|
my $ret = DevIo_OpenDev( $hash, 0, undef);
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
# connect using serial connection (old blocking style)
|
# connect using TCP connection (non-blocking style)
|
||||||
if ( $hash->{Protocol} eq "serial" )
|
else {
|
||||||
{
|
# add missing port if required
|
||||||
my $ret = DevIo_OpenDev( $hash, 0, undef);
|
$hash->{DeviceName} = $hash->{DeviceName} . ":8102"
|
||||||
return $ret;
|
if ( $hash->{DeviceName} !~ m/^(.+):([0-9]+)$/ );
|
||||||
}
|
|
||||||
|
|
||||||
# connect using TCP connection (non-blocking style)
|
DevIo_OpenDev(
|
||||||
else {
|
$hash, 0,
|
||||||
# add missing port if required
|
"PIONEERAVR_DevInit",
|
||||||
$hash->{DeviceName} = $hash->{DeviceName} . ":8102"
|
sub() {
|
||||||
if ( $hash->{DeviceName} !~ m/^(.+):([0-9]+)$/ );
|
my ( $hash, $err ) = @_;
|
||||||
|
Log3 $name, 4, "PIONEERAVR $name: devName: $devicename HashDevName $hash->{DeviceName}";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
DevIo_OpenDev(
|
$hash->{helper}{receiver} = undef;
|
||||||
$hash, 0,
|
|
||||||
"PIONEERAVR_DevInit",
|
|
||||||
sub() {
|
|
||||||
my ( $hash, $err ) = @_;
|
|
||||||
Log3 $name, 4, "PIONEERAVR $name: devName: $devicename HashDevName $hash->{DeviceName}";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hash->{helper}{receiver} = undef;
|
unless ( exists( $hash->{helper}{AVAILABLE} ) and ( $hash->{helper}{AVAILABLE} == 0 ))
|
||||||
|
{
|
||||||
|
$hash->{helper}{AVAILABLE} = 1;
|
||||||
|
readingsSingleUpdate( $hash, "presence", "present", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
unless ( exists( $hash->{helper}{AVAILABLE} ) and ( $hash->{helper}{AVAILABLE} == 0 ))
|
# $hash->{helper}{INPUTNAMES} lists the default input names and their inputNr as provided by Pioneer.
|
||||||
{
|
# This module tries to read those names and the alias names from the AVR receiver and tries to check if this input is enabled or disabled
|
||||||
$hash->{helper}{AVAILABLE} = 1;
|
# So this list is just a fall back if the module can't read the names ...
|
||||||
readingsSingleUpdate( $hash, "presence", "present", 1 );
|
# InputNr with player functions (play,pause,...) ("13","17","18","26","27","33","38","41","44","45","48","53"); # Input number for usbDac, ipodUsb, xmRadio, homeMediaGallery, sirius, adapterPort, internetRadio, pandora, mediaServer, Favorites, mhl, spotify
|
||||||
}
|
# Additionally this module tries to get information from the Pioneer AVR
|
||||||
|
# - about the input level adjust
|
||||||
# $hash->{helper}{INPUTNAMES} lists the default input names and their inputNr as provided by Pioneer.
|
# - to which connector each input is connected.
|
||||||
# This module tries to read those names and the alias names from the AVR receiver and tries to check if this input is enabled or disabled
|
# There are 3 groups of connectors:
|
||||||
# So this list is just a fall back if the module can't read the names ...
|
# - Audio connectors (possible values are: ANALOG, COAX 1...3, OPT 1...3)
|
||||||
# InputNr with player functions (play,pause,...) ("13","17","18","26","27","33","38","41","44","45","48","53"); # Input number for usbDac, ipodUsb, xmRadio, homeMediaGallery, sirius, adapterPort, internetRadio, pandora, mediaServer, Favorites, mhl, spotify
|
# - Component connectors (anaolog video, possible values: COMPONENT 1...3)
|
||||||
# Additionally this module tries to get information from the Pioneer AVR
|
# - HDMI connectors (possible values are hdmi 1 ... hdmi 8)
|
||||||
# - about the input level adjust
|
$hash->{helper}{INPUTNAMES} = {
|
||||||
# - to which connector each input is connected.
|
"00" => {"name" => "phono", "aliasName" => "", "enabled" => "1", "playerCommands" => "0", "audioTerminal" => "No Assign", "componentTerminal" => "No Assign", "hdmiTerminal" => "No Assign", "inputLevelAdjust" => 1},
|
||||||
# There are 3 groups of connectors:
|
"01" => {"name" => "cd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
# - Audio connectors (possible values are: ANALOG, COAX 1...3, OPT 1...3)
|
"02" => {"name" => "tuner", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
# - Component connectors (anaolog video, possible values: COMPONENT 1...3)
|
"03" => {"name" => "cdrTape", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
# - HDMI connectors (possible values are hdmi 1 ... hdmi 8)
|
"04" => {"name" => "dvd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
$hash->{helper}{INPUTNAMES} = {
|
"05" => {"name" => "tvSat", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"00" => {"name" => "phono", "aliasName" => "", "enabled" => "1", "playerCommands" => "0", "audioTerminal" => "No Assign", "componentTerminal" => "No Assign", "hdmiTerminal" => "No Assign", "inputLevelAdjust" => 1},
|
"06" => {"name" => "cblSat", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"01" => {"name" => "cd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"10" => {"name" => "video1", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"02" => {"name" => "tuner", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"12" => {"name" => "multiChIn", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"03" => {"name" => "cdrTape", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"13" => {"name" => "usbDac", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"04" => {"name" => "dvd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"14" => {"name" => "video2", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"05" => {"name" => "tvSat", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"15" => {"name" => "dvrBdr", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"06" => {"name" => "cblSat", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"17" => {"name" => "iPodUsb", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"10" => {"name" => "video1", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"18" => {"name" => "xmRadio", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"12" => {"name" => "multiChIn", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"19" => {"name" => "hdmi1", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"13" => {"name" => "usbDac", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"20" => {"name" => "hdmi2", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"14" => {"name" => "video2", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"21" => {"name" => "hdmi3", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"15" => {"name" => "dvrBdr", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"22" => {"name" => "hdmi4", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"17" => {"name" => "iPodUsb", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"23" => {"name" => "hdmi5", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"18" => {"name" => "xmRadio", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"24" => {"name" => "hdmi6", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"19" => {"name" => "hdmi1", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"25" => {"name" => "bd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"20" => {"name" => "hdmi2", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"26" => {"name" => "homeMediaGallery", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"21" => {"name" => "hdmi3", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"27" => {"name" => "sirius", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"22" => {"name" => "hdmi4", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"31" => {"name" => "hdmiCyclic", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"23" => {"name" => "hdmi5", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"33" => {"name" => "adapterPort", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"24" => {"name" => "hdmi6", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"34" => {"name" => "hdmi7", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"25" => {"name" => "bd", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"35" => {"name" => "hdmi8", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
||||||
"26" => {"name" => "homeMediaGallery", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"38" => {"name" => "internetRadio", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"27" => {"name" => "sirius", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"41" => {"name" => "pandora", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"31" => {"name" => "hdmiCyclic", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"44" => {"name" => "mediaServer", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"33" => {"name" => "adapterPort", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
"45" => {"name" => "favorites", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"34" => {"name" => "hdmi7", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"48" => {"name" => "mhl", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
||||||
"35" => {"name" => "hdmi8", "aliasName" => "", "enabled" => "1", "playerCommands" => "0"},
|
"53" => {"name" => "spotify", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"}
|
||||||
"38" => {"name" => "internetRadio", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
};
|
||||||
"41" => {"name" => "pandora", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
|
||||||
"44" => {"name" => "mediaServer", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
|
||||||
"45" => {"name" => "favorites", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
|
||||||
"48" => {"name" => "mhl", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"},
|
|
||||||
"53" => {"name" => "spotify", "aliasName" => "", "enabled" => "1", "playerCommands" => "1"}
|
|
||||||
};
|
|
||||||
# ----------------Human Readable command mapping table for "set" commands-----------------------
|
# ----------------Human Readable command mapping table for "set" commands-----------------------
|
||||||
$hash->{helper}{SETS} = {
|
$hash->{helper}{SETS} = {
|
||||||
'main' => {
|
'main' => {
|
||||||
'on' => 'PO',
|
'on' => 'PO',
|
||||||
'off' => 'PF',
|
'off' => 'PF',
|
||||||
'toggle' => 'PZ',
|
'toggle' => 'PZ',
|
||||||
'volumeUp' => 'VU',
|
'volumeUp' => 'VU',
|
||||||
'volumeDown' => 'VD',
|
'volumeDown' => 'VD',
|
||||||
'volume' => 'VL',
|
'volume' => 'VL',
|
||||||
'muteOn' => 'MO',
|
'muteOn' => 'MO',
|
||||||
'muteOff' => 'MF',
|
'muteOff' => 'MF',
|
||||||
'muteToggle' => 'MZ',
|
'muteToggle' => 'MZ',
|
||||||
'bassUp' => 'BI',
|
'bassUp' => 'BI',
|
||||||
'bassDown' => 'BD',
|
'bassDown' => 'BD',
|
||||||
'trebleUp' => 'TI',
|
'trebleUp' => 'TI',
|
||||||
'trebleDown' => 'TD',
|
'trebleDown' => 'TD',
|
||||||
'input' => 'FN',
|
'input' => 'FN',
|
||||||
'inputUp' => 'FU',
|
'inputUp' => 'FU',
|
||||||
'inputDown' => 'FD',
|
'inputDown' => 'FD',
|
||||||
'channelUp' => 'TPI',
|
'channelUp' => 'TPI',
|
||||||
'channelDown' => 'TPD',
|
'channelDown' => 'TPD',
|
||||||
'0Network' => '00NW',
|
'0Network' => '00NW',
|
||||||
'1Network' => '01NW',
|
'1Network' => '01NW',
|
||||||
'2Network' => '02NW',
|
'2Network' => '02NW',
|
||||||
'3Network' => '03NW',
|
'3Network' => '03NW',
|
||||||
'4Network' => '04NW',
|
'4Network' => '04NW',
|
||||||
'5Network' => '05NW',
|
'5Network' => '05NW',
|
||||||
'6Network' => '06NW',
|
'6Network' => '06NW',
|
||||||
'7Network' => '07NW',
|
'7Network' => '07NW',
|
||||||
'8Network' => '08NW',
|
'8Network' => '08NW',
|
||||||
'9Network' => '09NW',
|
'9Network' => '09NW',
|
||||||
'prevNetwork' => '12NW',
|
'prevNetwork' => '12NW',
|
||||||
'nextNetwork' => '13NW',
|
'nextNetwork' => '13NW',
|
||||||
'revNetwork' => '14NW',
|
'revNetwork' => '14NW',
|
||||||
'fwdNetwork' => '15NW',
|
'fwdNetwork' => '15NW',
|
||||||
'upNetwork' => '26NW',
|
'upNetwork' => '26NW',
|
||||||
'downNetwork' => '27NW',
|
'downNetwork' => '27NW',
|
||||||
'rightNetwork' => '28NW',
|
'rightNetwork' => '28NW',
|
||||||
'leftNetwork' => '29NW',
|
'leftNetwork' => '29NW',
|
||||||
'enterNetwork' => '30NW',
|
'enterNetwork' => '30NW',
|
||||||
'returnNetwork' => '31NW',
|
'returnNetwork' => '31NW',
|
||||||
'menuNetwork' => '36NW',
|
'menuNetwork' => '36NW',
|
||||||
'playNetwork' => '10NW',
|
'playNetwork' => '10NW',
|
||||||
'pauseNetwork' => '11NW',
|
'pauseNetwork' => '11NW',
|
||||||
'stopNetwork' => '20NW',
|
'stopNetwork' => '20NW',
|
||||||
'repeatNetwork' => '34NW',
|
'repeatNetwork' => '34NW',
|
||||||
'shuffleNetwork' => '35NW',
|
'shuffleNetwork' => '35NW',
|
||||||
'selectLine01' => '01GFH',
|
'updateScreenNetwork' => '?GAH',
|
||||||
'selectLine02' => '02GFH',
|
'selectLine01Network' => '01GFH',
|
||||||
'selectLine03' => '03GFH',
|
'selectLine02Network' => '02GFH',
|
||||||
'selectLine04' => '04GFH',
|
'selectLine03Network' => '03GFH',
|
||||||
'selectLine05' => '05GFH',
|
'selectLine04Network' => '04GFH',
|
||||||
'selectLine06' => '06GFH',
|
'selectLine05Network' => '05GFH',
|
||||||
'selectLine07' => '07GFH',
|
'selectLine06Network' => '06GFH',
|
||||||
'selectLine08' => '08GFH',
|
'selectLine07Network' => '07GFH',
|
||||||
'playIpod' => '00IP',
|
'selectLine08Network' => '08GFH',
|
||||||
'pauseIpod' => '01IP',
|
'selectScreenPageNetwork'=> 'GGH',
|
||||||
'stopIpod' => '02IP',
|
'playIpod' => '00IP',
|
||||||
'repeatIpod' => '07IP',
|
'pauseIpod' => '01IP',
|
||||||
'shuffleIpod' => '08IP',
|
'stopIpod' => '02IP',
|
||||||
'prevIpod' => '03IP',
|
'repeatIpod' => '07IP',
|
||||||
'nextIpod' => '04IP',
|
'shuffleIpod' => '08IP',
|
||||||
'revIpod' => '05IP',
|
'prevIpod' => '03IP',
|
||||||
'fwdIpod' => '06IP',
|
'nextIpod' => '04IP',
|
||||||
'upIpod' => '13IP',
|
'revIpod' => '05IP',
|
||||||
'downIpod' => '14IP',
|
'fwdIpod' => '06IP',
|
||||||
'rightIpod' => '15IP',
|
'upIpod' => '13IP',
|
||||||
'leftIpod' => '16IP',
|
'downIpod' => '14IP',
|
||||||
'enterIpod' => '17IP',
|
'rightIpod' => '15IP',
|
||||||
'returnIpod' => '18IP',
|
'leftIpod' => '16IP',
|
||||||
'menuIpod' => '19IP',
|
'enterIpod' => '17IP',
|
||||||
'playAdapterPort' => '10BT',
|
'returnIpod' => '18IP',
|
||||||
'pauseAdapterPort' => '11BT',
|
'menuIpod' => '19IP',
|
||||||
'stopAdapterPort' => '12BT',
|
'updateScreenIpod' => '?GAI',
|
||||||
'repeatAdapterPort' => '17BT',
|
'selectLine01Ipod' => '01GFI',
|
||||||
'shuffleAdapterPort' => '18BT',
|
'selectLine02Ipod' => '02GFI',
|
||||||
'prevAdapterPort' => '13BT',
|
'selectLine03Ipod' => '03GFI',
|
||||||
'nextAdapterPort' => '14BT',
|
'selectLine04Ipod' => '04GFI',
|
||||||
'revAdapterPort' => '15BT',
|
'selectLine05Ipod' => '05GFI',
|
||||||
'fwdAdapterPort' => '16BT',
|
'selectLine06Ipod' => '06GFI',
|
||||||
'upAdapterPort' => '21BT',
|
'selectLine07Ipod' => '07GFI',
|
||||||
'downAdapterPort' => '22BT',
|
'selectLine08Ipod' => '08GFI',
|
||||||
'rightAdapterPort' => '23BT',
|
'selectScreenPageIpod' => 'GGI',
|
||||||
'leftAdapterPort' => '24BT',
|
'playAdapterPort' => '10BT',
|
||||||
'enterAdapterPort' => '25BT',
|
'pauseAdapterPort' => '11BT',
|
||||||
'returnAdapterPort' => '26BT',
|
'stopAdapterPort' => '12BT',
|
||||||
'menuAdapterPort' => '27BT',
|
'repeatAdapterPort' => '17BT',
|
||||||
'playMhl' => '23MHL',
|
'shuffleAdapterPort' => '18BT',
|
||||||
'pauseMhl' => '25MHL',
|
'prevAdapterPort' => '13BT',
|
||||||
'stopMhl' => '24MHL',
|
'nextAdapterPort' => '14BT',
|
||||||
'0Mhl' => '07MHL',
|
'revAdapterPort' => '15BT',
|
||||||
'1Mhl' => '08MHL',
|
'fwdAdapterPort' => '16BT',
|
||||||
'2Mhl' => '09MHL',
|
'upAdapterPort' => '21BT',
|
||||||
'3Mhl' => '10MHL',
|
'downAdapterPort' => '22BT',
|
||||||
'4Mhl' => '11MHL',
|
'rightAdapterPort' => '23BT',
|
||||||
'5Mhl' => '12MHL',
|
'leftAdapterPort' => '24BT',
|
||||||
'6Mhl' => '13MHL',
|
'enterAdapterPort' => '25BT',
|
||||||
'7Mhl' => '14MHL',
|
'returnAdapterPort' => '26BT',
|
||||||
'8Mhl' => '15MHL',
|
'menuAdapterPort' => '27BT',
|
||||||
'9Mhl' => '16MHL',
|
'playMhl' => '23MHL',
|
||||||
'prevMhl' => '31MHL',
|
'pauseMhl' => '25MHL',
|
||||||
'nextMhl' => '30MHL',
|
'stopMhl' => '24MHL',
|
||||||
'revMhl' => '27MHL',
|
'0Mhl' => '07MHL',
|
||||||
'fwdMhl' => '28MHL',
|
'1Mhl' => '08MHL',
|
||||||
'upMhl' => '01MHL',
|
'2Mhl' => '09MHL',
|
||||||
'downMhl' => '02MHL',
|
'3Mhl' => '10MHL',
|
||||||
'rightMhl' => '04MHL',
|
'4Mhl' => '11MHL',
|
||||||
'leftMhl' => '03MHL',
|
'5Mhl' => '12MHL',
|
||||||
'enterMhl' => '17MHL',
|
'6Mhl' => '13MHL',
|
||||||
'returnMhl' => '06MHL',
|
'7Mhl' => '14MHL',
|
||||||
'menuMhl' => '05MHL'
|
'8Mhl' => '15MHL',
|
||||||
|
'9Mhl' => '16MHL',
|
||||||
|
'prevMhl' => '31MHL',
|
||||||
|
'nextMhl' => '30MHL',
|
||||||
|
'revMhl' => '27MHL',
|
||||||
|
'fwdMhl' => '28MHL',
|
||||||
|
'upMhl' => '01MHL',
|
||||||
|
'downMhl' => '02MHL',
|
||||||
|
'rightMhl' => '04MHL',
|
||||||
|
'leftMhl' => '03MHL',
|
||||||
|
'enterMhl' => '17MHL',
|
||||||
|
'returnMhl' => '06MHL',
|
||||||
|
'menuMhl' => '05MHL'
|
||||||
},
|
},
|
||||||
'zone2' => {
|
'zone2' => {
|
||||||
'on' => 'APO',
|
'on' => 'APO',
|
||||||
@ -952,16 +958,7 @@ sub PIONEERAVR_Define($$) {
|
|||||||
"31"=>"buffer",
|
"31"=>"buffer",
|
||||||
"33"=>"station"
|
"33"=>"station"
|
||||||
};
|
};
|
||||||
$hash->{helper}{SCREENTYPES} = {
|
|
||||||
"00"=>"Message",
|
|
||||||
"01"=>"List",
|
|
||||||
"02"=>"Playing(Play)",
|
|
||||||
"03"=>"Playing(Pause)",
|
|
||||||
"04"=>"Playing(Fwd)",
|
|
||||||
"05"=>"Playing(Rev)",
|
|
||||||
"06"=>"Playing(Stop)",
|
|
||||||
"99"=>"Drawing invalid"
|
|
||||||
};
|
|
||||||
# indicates what the source of the screen information is
|
# indicates what the source of the screen information is
|
||||||
$hash->{helper}{SOURCEINFO} = {
|
$hash->{helper}{SOURCEINFO} = {
|
||||||
"00"=>"Internet Radio",
|
"00"=>"Internet Radio",
|
||||||
@ -1263,8 +1260,17 @@ sub PIONEERAVR_Define($$) {
|
|||||||
"23"=>"screenName",
|
"23"=>"screenName",
|
||||||
"24"=>"screenHierarchy",
|
"24"=>"screenHierarchy",
|
||||||
"25"=>"screenTopMenuKey",
|
"25"=>"screenTopMenuKey",
|
||||||
"26"=>"screenIpodKey",
|
"26"=>"screenToolsKey",
|
||||||
"27"=>"screenReturnKey"
|
"27"=>"screenReturnKey",
|
||||||
|
"28"=>"playStatus",
|
||||||
|
"29"=>"sourceInfo",
|
||||||
|
"30"=>"currentAlbum",
|
||||||
|
"31"=>"currentArtist",
|
||||||
|
"32"=>"currentTitle",
|
||||||
|
"33"=>"channel",
|
||||||
|
"34"=>"channelName",
|
||||||
|
"35"=>"channelStraight",
|
||||||
|
"36"=>"tunerFrequency"
|
||||||
};
|
};
|
||||||
|
|
||||||
### initialize timer
|
### initialize timer
|
||||||
@ -1438,7 +1444,7 @@ sub PIONEERAVR_Notify($$) {
|
|||||||
readingsBulkUpdate( $hash, "stateAV", $stateAV )
|
readingsBulkUpdate( $hash, "stateAV", $stateAV )
|
||||||
if ( ReadingsVal( $name, "stateAV", "-" ) ne $stateAV );
|
if ( ReadingsVal( $name, "stateAV", "-" ) ne $stateAV );
|
||||||
|
|
||||||
PIONEERAVR_Write( $hash, "?P\n\r?M\n\r?V\n\r\F\n\r" );
|
PIONEERAVR_Write( $hash, "?P\n\r?M\n\r?V\n\r\?F\n\r" );
|
||||||
|
|
||||||
# send to slaves
|
# send to slaves
|
||||||
if ( $definedZones > 1 ) {
|
if ( $definedZones > 1 ) {
|
||||||
@ -1513,7 +1519,17 @@ PIONEERAVR_Set($@)
|
|||||||
"left",
|
"left",
|
||||||
"enter",
|
"enter",
|
||||||
"return",
|
"return",
|
||||||
"menu"); # available commands for certain inputs (@playerInputNr)
|
"menu",
|
||||||
|
"updateScreen",
|
||||||
|
"selectLine01",
|
||||||
|
"selectLine02",
|
||||||
|
"selectLine03",
|
||||||
|
"selectLine04",
|
||||||
|
"selectLine05",
|
||||||
|
"selectLine06",
|
||||||
|
"selectLine07",
|
||||||
|
"selectLine08",
|
||||||
|
"selectScreenPage"); # available commands for certain inputs (@playerInputNr)
|
||||||
my @playerInputNr = ("13","17","18","26","27","33","38","41","44","45","48","53"); # Input number for usbDac, ipodUsb, xmRadio, homeMediaGallery, sirius, adapterPort, internetRadio, pandora, mediaServer, Favorites, mhl, spotify
|
my @playerInputNr = ("13","17","18","26","27","33","38","41","44","45","48","53"); # Input number for usbDac, ipodUsb, xmRadio, homeMediaGallery, sirius, adapterPort, internetRadio, pandora, mediaServer, Favorites, mhl, spotify
|
||||||
my @setsTuner = ("channelUp",
|
my @setsTuner = ("channelUp",
|
||||||
"channelDown",
|
"channelDown",
|
||||||
@ -1527,15 +1543,7 @@ PIONEERAVR_Set($@)
|
|||||||
"muteOff",
|
"muteOff",
|
||||||
"muteToggle",
|
"muteToggle",
|
||||||
"inputUp",
|
"inputUp",
|
||||||
"inputDown",
|
"inputDown" ); # set commands without arguments
|
||||||
"selectLine01",
|
|
||||||
"selectLine02",
|
|
||||||
"selectLine03",
|
|
||||||
"selectLine04",
|
|
||||||
"selectLine05",
|
|
||||||
"selectLine06",
|
|
||||||
"selectLine07",
|
|
||||||
"selectLine08" ); # set commands without arguments
|
|
||||||
my $playerCmd = "";
|
my $playerCmd = "";
|
||||||
my $inputNr = "";
|
my $inputNr = "";
|
||||||
|
|
||||||
@ -1597,7 +1605,7 @@ PIONEERAVR_Set($@)
|
|||||||
if ( $inputNr ~~ @playerInputNr ) {
|
if ( $inputNr ~~ @playerInputNr ) {
|
||||||
$list .= " play:noArg stop:noArg pause:noArg repeat:noArg shuffle:noArg prev:noArg next:noArg rev:noArg fwd:noArg up:noArg down:noArg";
|
$list .= " play:noArg stop:noArg pause:noArg repeat:noArg shuffle:noArg prev:noArg next:noArg rev:noArg fwd:noArg up:noArg down:noArg";
|
||||||
$list .= " right:noArg left:noArg enter:noArg return:noArg menu:noArg";
|
$list .= " right:noArg left:noArg enter:noArg return:noArg menu:noArg";
|
||||||
$list .= " selectLine01:noArg selectLine02:noArg selectLine03:noArg selectLine04:noArg selectLine05:noArg selectLine06:noArg selectLine07:noArg selectLine08:noArg";
|
$list .= " updateScreen:noArg selectLine01:noArg selectLine02:noArg selectLine03:noArg selectLine04:noArg selectLine05:noArg selectLine06:noArg selectLine07:noArg selectLine08:noArg selectScreenPage ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$list .= " networkStandby:on,off";
|
$list .= " networkStandby:on,off";
|
||||||
@ -1661,14 +1669,50 @@ PIONEERAVR_Set($@)
|
|||||||
} elsif ($cmd ~~ @setsPlayer) {
|
} elsif ($cmd ~~ @setsPlayer) {
|
||||||
Log3 $name, 5, "PIONEERAVR $name: set $cmd for inputNr: $inputNr (player command)";
|
Log3 $name, 5, "PIONEERAVR $name: set $cmd for inputNr: $inputNr (player command)";
|
||||||
if ($inputNr eq "17") {
|
if ($inputNr eq "17") {
|
||||||
$playerCmd= $cmd."Ipod";
|
if ( $cmd eq "selectScreenPage" ) {
|
||||||
} elsif ($inputNr eq "33") {
|
my $setCmd = sprintf "%05dGGI", $arg;
|
||||||
|
PIONEERAVR_Write( $hash, $setCmd);
|
||||||
|
return undef;
|
||||||
|
} else {
|
||||||
|
$playerCmd = $cmd."Ipod";
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif ($inputNr eq "33"
|
||||||
|
&& ( $cmd ne "updateScreen" )
|
||||||
|
&& ( $cmd ne "selectLine01" )
|
||||||
|
&& ( $cmd ne "selectLine02" )
|
||||||
|
&& ( $cmd ne "selectLine03" )
|
||||||
|
&& ( $cmd ne "selectLine04" )
|
||||||
|
&& ( $cmd ne "selectLine05" )
|
||||||
|
&& ( $cmd ne "selectLine06" )
|
||||||
|
&& ( $cmd ne "selectLine07" )
|
||||||
|
&& ( $cmd ne "selectLine08" )
|
||||||
|
&& ( $cmd ne "selectScreenPage") ) {
|
||||||
$playerCmd= $cmd."AdapterPort";
|
$playerCmd= $cmd."AdapterPort";
|
||||||
#### homeMediaGallery, sirius, internetRadio, pandora, mediaServer, favorites, spotify
|
#### homeMediaGallery, sirius, internetRadio, pandora, mediaServer, favorites, spotify
|
||||||
} elsif (($inputNr eq "26") ||($inputNr eq "27") || ($inputNr eq "38") || ($inputNr eq "41") || ($inputNr eq "44") || ($inputNr eq "45") || ($inputNr eq "53")) {
|
} elsif (($inputNr eq "26") ||($inputNr eq "27") || ($inputNr eq "38") || ($inputNr eq "41") || ($inputNr eq "44") || ($inputNr eq "45") || ($inputNr eq "53")) {
|
||||||
$playerCmd= $cmd."Network";
|
if ( $cmd eq "selectScreenPage" ) {
|
||||||
|
my $setCmd = sprintf "%05dGGH", $arg;
|
||||||
|
PIONEERAVR_Write( $hash, $setCmd);
|
||||||
|
return undef;
|
||||||
|
} else {
|
||||||
|
$playerCmd= $cmd."Network";
|
||||||
|
}
|
||||||
|
|
||||||
#### 'random' and 'repeat' are not available on input mhl
|
#### 'random' and 'repeat' are not available on input mhl
|
||||||
} elsif (($inputNr eq "48") && ( $cmd ne "repeat") && ( $cmd ne "random")) {
|
} elsif (($inputNr eq "48")
|
||||||
|
&& ( $cmd ne "repeat")
|
||||||
|
&& ( $cmd ne "random")
|
||||||
|
&& ( $cmd ne "updateScreen" )
|
||||||
|
&& ( $cmd ne "selectLine01" )
|
||||||
|
&& ( $cmd ne "selectLine02" )
|
||||||
|
&& ( $cmd ne "selectLine03" )
|
||||||
|
&& ( $cmd ne "selectLine04" )
|
||||||
|
&& ( $cmd ne "selectLine05" )
|
||||||
|
&& ( $cmd ne "selectLine06" )
|
||||||
|
&& ( $cmd ne "selectLine07" )
|
||||||
|
&& ( $cmd ne "selectLine08" )
|
||||||
|
&& ( $cmd ne "selectScreenPage" ) ) {
|
||||||
$playerCmd= $cmd."Mhl";
|
$playerCmd= $cmd."Mhl";
|
||||||
} else {
|
} else {
|
||||||
my $err= "PIONEERAVR $name: The command $cmd for input nr. $inputNr is not possible!";
|
my $err= "PIONEERAVR $name: The command $cmd for input nr. $inputNr is not possible!";
|
||||||
@ -1952,7 +1996,7 @@ PIONEERAVR_Set($@)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#####################################
|
#####################################
|
||||||
sub PIONEERAVR_Get($$$) {
|
sub PIONEERAVR_Get($@) {
|
||||||
my ( $hash, $a, $h ) = @_;
|
my ( $hash, $a, $h ) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $cmd = @$a[1];
|
my $cmd = @$a[1];
|
||||||
@ -2022,7 +2066,7 @@ sub PIONEERAVR_Read($)
|
|||||||
|
|
||||||
# reset connectionCheck timer
|
# reset connectionCheck timer
|
||||||
my $checkInterval = AttrVal( $name, "connectionCheck", "60" );
|
my $checkInterval = AttrVal( $name, "connectionCheck", "60" );
|
||||||
RemoveInternalTimer( $hash);
|
RemoveInternalTimer( $hash, "PIONEERAVR_connectionCheck" );
|
||||||
if ( $checkInterval ne "off" ) {
|
if ( $checkInterval ne "off" ) {
|
||||||
my $next = gettimeofday() + $checkInterval;
|
my $next = gettimeofday() + $checkInterval;
|
||||||
$hash->{helper}{nextConnectionCheck} = $next;
|
$hash->{helper}{nextConnectionCheck} = $next;
|
||||||
@ -2673,7 +2717,7 @@ sub PIONEERAVR_Read($)
|
|||||||
# $4: Top menu key flag
|
# $4: Top menu key flag
|
||||||
# 0:Invalidity
|
# 0:Invalidity
|
||||||
# 1:Effectiveness
|
# 1:Effectiveness
|
||||||
# $5: iPod Control Key Information
|
# $5: Tools (menu, edit,iPod Control) Key Information
|
||||||
# 0:Invalidity
|
# 0:Invalidity
|
||||||
# 1:Effectiveness
|
# 1:Effectiveness
|
||||||
# $6: Return Key Information
|
# $6: Return Key Information
|
||||||
@ -2688,9 +2732,27 @@ sub PIONEERAVR_Read($)
|
|||||||
readingsBulkUpdate( $hash, "screenName", $8 );
|
readingsBulkUpdate( $hash, "screenName", $8 );
|
||||||
readingsBulkUpdate( $hash, "screenHierarchy", $3 );
|
readingsBulkUpdate( $hash, "screenHierarchy", $3 );
|
||||||
readingsBulkUpdate( $hash, "screenTopMenuKey", $4 );
|
readingsBulkUpdate( $hash, "screenTopMenuKey", $4 );
|
||||||
readingsBulkUpdate( $hash, "screenIpodKey", $5 );
|
readingsBulkUpdate( $hash, "screenToolsKey", $5 );
|
||||||
readingsBulkUpdate( $hash, "screenReturnKey", $6 );
|
readingsBulkUpdate( $hash, "screenReturnKey", $6 );
|
||||||
|
|
||||||
|
# to update the OSD/screen while playing from iPad/network a command has to be sent regulary
|
||||||
|
if ($2 eq "02" ) {
|
||||||
|
# reset screenUpdate timer -> again in 5s
|
||||||
|
my $checkInterval = 5;
|
||||||
|
my $next = gettimeofday() + $checkInterval;
|
||||||
|
$hash->{helper}{nextScreenUpdate} = $next;
|
||||||
|
InternalTimer( $next, "PIONEERAVR_screenUpdate", $hash, 0 );
|
||||||
|
readingsBulkUpdate( $hash, "playStatus", "playing" );
|
||||||
|
} elsif ( $2 eq "03" ) {
|
||||||
|
readingsBulkUpdate( $hash, "playStatus", "paused" );
|
||||||
|
} elsif ( $2 eq "04" ) {
|
||||||
|
readingsBulkUpdate( $hash, "playStatus", "fast-forward" );
|
||||||
|
} elsif ( $2 eq "05" ) {
|
||||||
|
readingsBulkUpdate( $hash, "playStatus", "fast-rewind" );
|
||||||
|
} elsif ( $2 eq "06" ) {
|
||||||
|
readingsBulkUpdate( $hash, "playStatus", "stopped" );
|
||||||
|
}
|
||||||
|
|
||||||
# Source information
|
# Source information
|
||||||
} elsif ( $line =~ m/^(GHH)(\d{2})$/ ) {
|
} elsif ( $line =~ m/^(GHH)(\d{2})$/ ) {
|
||||||
my $sourceInfo = $hash->{helper}{SOURCEINFO}{$2};
|
my $sourceInfo = $hash->{helper}{SOURCEINFO}{$2};
|
||||||
@ -2994,18 +3056,18 @@ sub PIONEERAVR_Write($$) {
|
|||||||
DevIo_SimpleWrite( $hash, $msg, 0 );
|
DevIo_SimpleWrite( $hash, $msg, 0 );
|
||||||
|
|
||||||
# do connection check latest after TIMEOUT
|
# do connection check latest after TIMEOUT
|
||||||
my $next = gettimeofday() + AttrVal( $name, "timeout", "3" );
|
my $next = gettimeofday() + AttrVal( $name, "timeout", "5" );
|
||||||
if ( !defined( $hash->{helper}{nextConnectionCheck} )
|
if ( !defined( $hash->{helper}{nextConnectionCheck} )
|
||||||
|| $hash->{helper}{nextConnectionCheck} > $next )
|
|| $hash->{helper}{nextConnectionCheck} > $next )
|
||||||
{
|
{
|
||||||
$hash->{helper}{nextConnectionCheck} = $next;
|
$hash->{helper}{nextConnectionCheck} = $next;
|
||||||
RemoveInternalTimer( $hash);
|
RemoveInternalTimer($hash, "PIONEERAVR_connectionCheck");
|
||||||
InternalTimer( $next, "PIONEERAVR_connectionCheck", $hash, 0 );
|
InternalTimer( $next, "PIONEERAVR_connectionCheck", $hash, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
# PIONEERAVR_checkConnection is called if PIONEERAVR received no data for 120s
|
# PIONEERAVR_connectionCheck is called if PIONEERAVR received no data for 120s
|
||||||
# we send a "new line" and expect (if the connection is up) to receive "R"
|
# we send a "new line" and expect (if the connection is up) to receive "R"
|
||||||
# DevIo_Expect() is used for this
|
# DevIo_Expect() is used for this
|
||||||
# DevIO_Expect() sends a command (just a "new line") and waits up to 5s for a reply
|
# DevIO_Expect() sends a command (just a "new line") and waits up to 5s for a reply
|
||||||
@ -3023,7 +3085,7 @@ sub PIONEERAVR_connectionCheck ($) {
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $verbose = AttrVal( $name, "verbose", "" );
|
my $verbose = AttrVal( $name, "verbose", "" );
|
||||||
|
|
||||||
RemoveInternalTimer( $hash );
|
RemoveInternalTimer( $hash, "PIONEERAVR_connectionCheck" );
|
||||||
|
|
||||||
$hash->{STATE} = "opened"; # assume we have an open connection
|
$hash->{STATE} = "opened"; # assume we have an open connection
|
||||||
$attr{$name}{verbose} = 0 if ( $verbose eq "" || $verbose < 4 );
|
$attr{$name}{verbose} = 0 if ( $verbose eq "" || $verbose < 4 );
|
||||||
@ -3031,7 +3093,7 @@ sub PIONEERAVR_connectionCheck ($) {
|
|||||||
my $connState =
|
my $connState =
|
||||||
DevIo_Expect( $hash,
|
DevIo_Expect( $hash,
|
||||||
"\r\n",
|
"\r\n",
|
||||||
AttrVal( $name, "timeout", "3" ) );
|
AttrVal( $name, "timeout", "5" ) );
|
||||||
|
|
||||||
# successful connection
|
# successful connection
|
||||||
if ( defined($connState) ) {
|
if ( defined($connState) ) {
|
||||||
@ -3045,20 +3107,47 @@ sub PIONEERAVR_connectionCheck ($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($connState =~ m/^R\r?\n?$/) {
|
if ($connState =~ m/^R\r?\n?$/) {
|
||||||
Log3 $name, 5, "PIONEERAVR $name: PIONEERAVR_checkConnection() --- connstate=R -> do nothing: ".dq($connState)." PARTIAL: ".dq( $hash->{PARTIAL});
|
Log3 $name, 5, "PIONEERAVR $name: PIONEERAVR_connectionCheck() --- connstate=R -> do nothing: ".dq($connState)." PARTIAL: ".dq( $hash->{PARTIAL});
|
||||||
} else {
|
} else {
|
||||||
$hash->{PARTIAL} .= $connState;
|
$hash->{PARTIAL} .= $connState;
|
||||||
Log3 $name, 5, "PIONEERAVR $name: PIONEERAVR_checkConnection() --- connstate<>R -> do nothing: ".dq($connState)." PARTIAL: ".dq( $hash->{PARTIAL});
|
Log3 $name, 5, "PIONEERAVR $name: PIONEERAVR_connectionCheck() --- connstate<>R -> do nothing: ".dq($connState)." PARTIAL: ".dq( $hash->{PARTIAL});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$attr{$name}{verbose} = $verbose if ( $verbose ne "" );
|
$attr{$name}{verbose} = $verbose if ( $verbose ne "" );
|
||||||
delete $attr{$name}{verbose} if ( $verbose eq "" );
|
delete $attr{$name}{verbose} if ( $verbose eq "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub PIONEERAVR_screenUpdate($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
my $cmd = "updateScreen";
|
||||||
|
my $playerCmd = "";
|
||||||
|
|
||||||
|
Log3 $name, 3, "PIONEERAVR $name: PIONEERAVR_screenUpdate()";
|
||||||
|
|
||||||
|
if ( defined( $hash->{helper}{main}{CURINPUTNR} ) ) {
|
||||||
|
my $inputNr = $hash->{helper}{main}{CURINPUTNR};
|
||||||
|
|
||||||
|
if ($inputNr eq "17") {
|
||||||
|
$playerCmd = $cmd."Ipod";
|
||||||
|
#### homeMediaGallery, sirius, internetRadio, pandora, mediaServer, favorites, spotify
|
||||||
|
} elsif (($inputNr eq "26") ||($inputNr eq "27") || ($inputNr eq "38") || ($inputNr eq "41") || ($inputNr eq "44") || ($inputNr eq "45") || ($inputNr eq "53")) {
|
||||||
|
$playerCmd = $cmd."Network";
|
||||||
|
} else {
|
||||||
|
my $err = "PIONEERAVR $name: The command $cmd for input nr. $inputNr is not possible!";
|
||||||
|
Log3 $name, 3, $err;
|
||||||
|
return $err;
|
||||||
|
}
|
||||||
|
my $setCmd = $hash->{helper}{SETS}{main}{$playerCmd};
|
||||||
|
PIONEERAVR_Write( $hash, $setCmd);
|
||||||
|
} else {
|
||||||
|
Log3 $name, 3, "PIONEERAVR $name: PIONEERAVR_screenUpdate(): can't find the inputNr";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
sub PIONEERAVR_statusUpdate($) {
|
sub PIONEERAVR_statusUpdate($) {
|
||||||
my ( $hash) = @_;
|
my ($hash) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
Log3 $name, 3, "PIONEERAVR $name: PIONEERAVR_statusUpdate()";
|
Log3 $name, 3, "PIONEERAVR $name: PIONEERAVR_statusUpdate()";
|
||||||
@ -3079,8 +3168,8 @@ sub PIONEERAVR_askForInputNames($$) {
|
|||||||
my $now120 = gettimeofday()+120;
|
my $now120 = gettimeofday()+120;
|
||||||
my $delay = 0.1;
|
my $delay = 0.1;
|
||||||
|
|
||||||
RemoveInternalTimer( $hash);
|
RemoveInternalTimer( $hash, "PIONEERAVR_connectionCheck" );
|
||||||
InternalTimer($now120, "PIONEERAVR_checkConnection", $hash, 0);
|
InternalTimer( $now120, "PIONEERAVR_connectionCheck", $hash, 0 );
|
||||||
|
|
||||||
# we ask for the inputs 1 to 59 if an input name exists (command: ?RGB00 ... ?RGB59)
|
# we ask for the inputs 1 to 59 if an input name exists (command: ?RGB00 ... ?RGB59)
|
||||||
# and if the input is disabled (command: ?SSC0003 ... ?SSC5903)
|
# and if the input is disabled (command: ?SSC0003 ... ?SSC5903)
|
||||||
@ -3120,7 +3209,6 @@ sub PIONEERAVR_askForInputNames($$) {
|
|||||||
sub PIONEERAVR_GetStateAV($) {
|
sub PIONEERAVR_GetStateAV($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $iNr = ReadingsVal( $name, "inputNr", "1" );
|
|
||||||
|
|
||||||
if ( ReadingsVal( $name, "presence", "absent" ) eq "absent" ) {
|
if ( ReadingsVal( $name, "presence", "absent" ) eq "absent" ) {
|
||||||
return "absent";
|
return "absent";
|
||||||
@ -3128,12 +3216,18 @@ sub PIONEERAVR_GetStateAV($) {
|
|||||||
return "off";
|
return "off";
|
||||||
} elsif ( ReadingsVal( $name, "mute", "off" ) eq "on" ) {
|
} elsif ( ReadingsVal( $name, "mute", "off" ) eq "on" ) {
|
||||||
return "muted";
|
return "muted";
|
||||||
} elsif ( $hash->{helper}{INPUTNAMES}->{$iNr}{playerCommands} eq "1"
|
|
||||||
&& ReadingsVal( $name, "playStatus", "stopped" ) ne "stopped" )
|
} elsif (defined( $hash->{helper}{main}{CURINPUTNR})) {
|
||||||
{
|
my $iNr = $hash->{helper}{main}{CURINPUTNR};
|
||||||
return ReadingsVal( $name, "playStatus", "stopped" );
|
if ( $hash->{helper}{INPUTNAMES}->{$iNr}{playerCommands} eq "1"
|
||||||
} else {
|
&& ReadingsVal( $name, "playStatus", "stopped" ) ne "stopped" )
|
||||||
return ReadingsVal( $name, "power", "off" );
|
{
|
||||||
|
return ReadingsVal( $name, "playStatus", "stopped" );
|
||||||
|
} else {
|
||||||
|
return ReadingsVal( $name, "power", "off" );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ReadingsVal( $name, "power", "off" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3370,7 +3464,7 @@ sub RC_layout_PioneerAVR() {
|
|||||||
<b>connectionCheck</b> 1..120,off Pings the Pioneer AVR every X seconds to verify connection status. Defaults to 60 seconds.
|
<b>connectionCheck</b> 1..120,off Pings the Pioneer AVR every X seconds to verify connection status. Defaults to 60 seconds.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>timeout</b> 1,2,3,4,5 Max time in seconds till the Pioneer AVR replies to a ping. Defaults to 3 seconds.
|
<b>timeout</b> 1,2,3,4,5,7,10,15 Max time in seconds till the Pioneer AVR replies to a ping. Defaults to 3 seconds.
|
||||||
</li>
|
</li>
|
||||||
<li><b>checkStatusStart <enable|disable></b> - Enables/disables the status update (read all values from the Pioneer AV receiver, can take up to one minute) when the module is loaded.(Default: enable)</li>
|
<li><b>checkStatusStart <enable|disable></b> - Enables/disables the status update (read all values from the Pioneer AV receiver, can take up to one minute) when the module is loaded.(Default: enable)</li>
|
||||||
<li><b>checkStatusReconnect <enable|disable></b> - Enables/disables the status update (read all values from the Pioneer AV receiver, can take up to one minute) when the connection to the Pioneer AV receiver is reestablished.(Default: enable)</li>
|
<li><b>checkStatusReconnect <enable|disable></b> - Enables/disables the status update (read all values from the Pioneer AV receiver, can take up to one minute) when the connection to the Pioneer AV receiver is reestablished.(Default: enable)</li>
|
||||||
@ -3417,8 +3511,9 @@ sub RC_layout_PioneerAVR() {
|
|||||||
<li><b>screenLineNumbers</b> - How many lines has the OSD</li>
|
<li><b>screenLineNumbers</b> - How many lines has the OSD</li>
|
||||||
<li><b>screenLineType01...08</b> - Which type has line 01...08? E.g. "directory", "Now playing", "current Artist",...</li>
|
<li><b>screenLineType01...08</b> - Which type has line 01...08? E.g. "directory", "Now playing", "current Artist",...</li>
|
||||||
<li><b>screenName</b> - Name of the OSD</li>
|
<li><b>screenName</b> - Name of the OSD</li>
|
||||||
<li><b>screenReturnKey</b> - Is the "Return-Key" in this ODS available?</li>
|
<li><b>screenReturnKey</b> - Is the "Return-Key" in this OSD available?</li>
|
||||||
<li><b>screenTopMenuKey</b> - Is the "Menu-Key" in this ODS available?</li>
|
<li><b>screenTopMenuKey</b> - Is the "Menu-Key" in this OSD available?</li>
|
||||||
|
<li><b>screenToolsKey</b> - Is the "Tools-Key" (Menu, edit, ipod control) in this OSD available?</li>
|
||||||
<li><b>screenType</b> - Type of the OSD, e.g. "message", "List", "playing(play)",...</li>
|
<li><b>screenType</b> - Type of the OSD, e.g. "message", "List", "playing(play)",...</li>
|
||||||
<li><b>speakerSystem</b> - Shows how the rear surround speaker connectors and the B-speaker connectors are used</li>
|
<li><b>speakerSystem</b> - Shows how the rear surround speaker connectors and the B-speaker connectors are used</li>
|
||||||
<li><b>speakers</b> - Which speaker output connectors are active?</li>
|
<li><b>speakers</b> - Which speaker output connectors are active?</li>
|
||||||
@ -3644,7 +3739,7 @@ sub RC_layout_PioneerAVR() {
|
|||||||
<b>connectionCheck</b> 1..120,off Pingt den Pioneer AV Receiver alle X Sekunden um den Datenverbindungsstatus zu überprüfen. Standard: 60 Sekunden.
|
<b>connectionCheck</b> 1..120,off Pingt den Pioneer AV Receiver alle X Sekunden um den Datenverbindungsstatus zu überprüfen. Standard: 60 Sekunden.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b> timeout</b> 1,2,3,4,5 Zeit in Sekunden, innerhalb der der Pioneer AV Receiver auf einen Ping antwortet. Standard: 3 Sekunden.
|
<b> timeout</b> 1,2,3,4,5,7,10,15 Zeit in Sekunden, innerhalb der der Pioneer AV Receiver auf einen Ping antwortet. Standard: 3 Sekunden.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>statusUpdateStart <enable|disable></b> - Ein-/Ausschalten des Status Updates (lesen aller Parameter vom Pioneer AV Receiver, dauert bis zu einer Minute) beim Start des Moduls.
|
<b>statusUpdateStart <enable|disable></b> - Ein-/Ausschalten des Status Updates (lesen aller Parameter vom Pioneer AV Receiver, dauert bis zu einer Minute) beim Start des Moduls.
|
||||||
@ -3697,6 +3792,7 @@ sub RC_layout_PioneerAVR() {
|
|||||||
<li><b>screenName</b> - Name des OSD</li>
|
<li><b>screenName</b> - Name des OSD</li>
|
||||||
<li><b>screenReturnKey</b> - Steht die "Return-Taste" in diesem OSD zur Verfügung?</li>
|
<li><b>screenReturnKey</b> - Steht die "Return-Taste" in diesem OSD zur Verfügung?</li>
|
||||||
<li><b>screenTopMenuKey</b> - Steht die "Menu-Taste" in diesem OSD zur Verfügung?</li>
|
<li><b>screenTopMenuKey</b> - Steht die "Menu-Taste" in diesem OSD zur Verfügung?</li>
|
||||||
|
<li><b>screenToolsKey</b> - Steht die "Tools-Taste" (Menu, Edit, iPod control) in diesem OSD zur Verfügung?</li>
|
||||||
<li><b>screenType</b> - Typ des OSD, z.B. "message", "List", "playing(play)",...</li>
|
<li><b>screenType</b> - Typ des OSD, z.B. "message", "List", "playing(play)",...</li>
|
||||||
<li><b>speakerSystem</b> - Zeigt, wie die hinteren Surround-Lautsprecheranschlüsse und die B-Lautsprecheranschlüsse verwendet werden</li>
|
<li><b>speakerSystem</b> - Zeigt, wie die hinteren Surround-Lautsprecheranschlüsse und die B-Lautsprecheranschlüsse verwendet werden</li>
|
||||||
<li><b>speakers</b> - Welche Lautsprecheranschlüsse sind aktiviert?</li>
|
<li><b>speakers</b> - Welche Lautsprecheranschlüsse sind aktiviert?</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user