mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +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,14 +155,9 @@ 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 ( $hash, $def) = @_;
|
|
||||||
# my @a = split("[ \t]+", $def);
|
|
||||||
# my $name = $hash->{NAME};
|
|
||||||
my $protocol = @$a[2];
|
my $protocol = @$a[2];
|
||||||
|
|
||||||
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
Log3 $name, 5, "PIONEERAVR $name: called function PIONEERAVR_Define()";
|
||||||
@ -172,7 +167,6 @@ sub PIONEERAVR_Define($$) {
|
|||||||
Log3 $name, 3, "PIONEERAVR $name: " . $msg;
|
Log3 $name, 3, "PIONEERAVR $name: " . $msg;
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
# $hash->{TYPE} = "PIONEERAVR";
|
|
||||||
|
|
||||||
RemoveInternalTimer( $hash);
|
RemoveInternalTimer( $hash);
|
||||||
DevIo_CloseDev( $hash);
|
DevIo_CloseDev( $hash);
|
||||||
@ -317,14 +311,16 @@ sub PIONEERAVR_Define($$) {
|
|||||||
'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',
|
||||||
|
'selectLine08Network' => '08GFH',
|
||||||
|
'selectScreenPageNetwork'=> 'GGH',
|
||||||
'playIpod' => '00IP',
|
'playIpod' => '00IP',
|
||||||
'pauseIpod' => '01IP',
|
'pauseIpod' => '01IP',
|
||||||
'stopIpod' => '02IP',
|
'stopIpod' => '02IP',
|
||||||
@ -341,6 +337,16 @@ sub PIONEERAVR_Define($$) {
|
|||||||
'enterIpod' => '17IP',
|
'enterIpod' => '17IP',
|
||||||
'returnIpod' => '18IP',
|
'returnIpod' => '18IP',
|
||||||
'menuIpod' => '19IP',
|
'menuIpod' => '19IP',
|
||||||
|
'updateScreenIpod' => '?GAI',
|
||||||
|
'selectLine01Ipod' => '01GFI',
|
||||||
|
'selectLine02Ipod' => '02GFI',
|
||||||
|
'selectLine03Ipod' => '03GFI',
|
||||||
|
'selectLine04Ipod' => '04GFI',
|
||||||
|
'selectLine05Ipod' => '05GFI',
|
||||||
|
'selectLine06Ipod' => '06GFI',
|
||||||
|
'selectLine07Ipod' => '07GFI',
|
||||||
|
'selectLine08Ipod' => '08GFI',
|
||||||
|
'selectScreenPageIpod' => 'GGI',
|
||||||
'playAdapterPort' => '10BT',
|
'playAdapterPort' => '10BT',
|
||||||
'pauseAdapterPort' => '11BT',
|
'pauseAdapterPort' => '11BT',
|
||||||
'stopAdapterPort' => '12BT',
|
'stopAdapterPort' => '12BT',
|
||||||
@ -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")) {
|
||||||
|
if ( $cmd eq "selectScreenPage" ) {
|
||||||
|
my $setCmd = sprintf "%05dGGH", $arg;
|
||||||
|
PIONEERAVR_Write( $hash, $setCmd);
|
||||||
|
return undef;
|
||||||
|
} else {
|
||||||
$playerCmd= $cmd."Network";
|
$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,13 +3216,19 @@ 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"
|
|
||||||
|
} elsif (defined( $hash->{helper}{main}{CURINPUTNR})) {
|
||||||
|
my $iNr = $hash->{helper}{main}{CURINPUTNR};
|
||||||
|
if ( $hash->{helper}{INPUTNAMES}->{$iNr}{playerCommands} eq "1"
|
||||||
&& ReadingsVal( $name, "playStatus", "stopped" ) ne "stopped" )
|
&& ReadingsVal( $name, "playStatus", "stopped" ) ne "stopped" )
|
||||||
{
|
{
|
||||||
return ReadingsVal( $name, "playStatus", "stopped" );
|
return ReadingsVal( $name, "playStatus", "stopped" );
|
||||||
} else {
|
} else {
|
||||||
return ReadingsVal( $name, "power", "off" );
|
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