Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Onkyo] Fix various issues #1529

Merged
merged 3 commits into from
Dec 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@
<description>Select the input source of the AVR</description>
<state>
<options>
<option value="00">DVR/VCR</option>
<option value="01">SATELLITE/CABLE</option>
<option value="02">GAME</option>
<option value="03">AUX</option>
<option value="04">GAME</option>
<option value="05">PC</option>
<option value="0">DVR/VCR</option>
<option value="1">SATELLITE/CABLE</option>
<option value="2">GAME</option>
<option value="3">AUX</option>
<option value="4">GAME2</option>
<option value="5">PC</option>
<option value="16">BLURAY/DVD</option>
<option value="17">STRM BOX</option>
<option value="18">TV</option>
<option value="32">TAPE1</option>
<option value="33">TAPE2</option>
<option value="34">PHONO</option>
Expand All @@ -125,10 +127,12 @@
<option value="41">USB</option>
<option value="42">USB_BACK</option>
<option value="43">NETWORK</option>
<option value="44">USB_TOGGLE</option>
<option value="45">AIRPLAY</option>
<option value="46">BLUETOOTH</option>
<option value="48">MULTICH</option>
<option value="50">SIRIUS</option>
<option value="128">SOURCE</option>
</options>
</state>
</channel-type>
Expand Down Expand Up @@ -156,23 +160,27 @@
<description>Listen mode</description>
<state>
<options>
<option value="00">Stereo</option>
<option value="03">Game RPG</option>
<option value="05">Game Action</option>
<option value="06">Game Rock</option>
<option value="08">Orchestra</option>
<option value="09">unplugged</option>
<option value="0">Stereo</option>
<option value="1">Direct</option>
<option value="3">Game RPG</option>
<option value="5">Game Action</option>
<option value="6">Game Rock</option>
<option value="8">Orchestra</option>
<option value="9">unplugged</option>
<option value="10">Studio Mix</option>
<option value="11">TV Logic</option>
<option value="12">All Channel Stereo</option>
<option value="12">Theater Dimensional</option>
<option value="13">Theater Dimensional</option>
<option value="14">Game-Sports</option>
<option value="15">Mono</option>
<option value="17">Pure Audio</option>
<option value="19">Mono</option>
<option value="19">Full Mono</option>
<option value="22">Audyssey DSX</option>
<option value="64">5.1ch Surround</option>
<option value="128">PLII/PLIIx Movie</option>
<option value="129">PLII/PLIIx Music</option>
<option value="131">Neo:6 Music</option>
<option value="130">Neo 6/Neo:X Cinema + DTS:X/Neural:X</option>
<option value="131">Neo 6/Neo:X Music</option>
<option value="134">PLII/PLIIx Game</option>
<option value="160">PLIIx/PLII Movie + Audyssey DSX</option>
<option value="161">PLIIx/PLII Music + Audyssey DSX</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ public void statusUpdateReceived(EventObject event, String ip, String data) {
updateState(CHANNEL_VOLUME, volume);
break;
case SOURCE_SET:
int input = Integer.parseInt(data.substring(3, 5), 16);
updateState(CHANNEL_INPUT, new DecimalType(input));
onInputChanged(input);
if (!data.substring(3, 5).contentEquals("N/")) {
int input = Integer.parseInt(data.substring(3, 5), 16);
updateState(CHANNEL_INPUT, new DecimalType(input));
onInputChanged(input);
}
break;
case NETUSB_SONG_ARTIST_QUERY:
updateState(CHANNEL_ARTIST, new StringType(data.substring(3, data.length())));
Expand All @@ -309,7 +311,7 @@ public void statusUpdateReceived(EventObject event, String ip, String data) {
case LISTEN_MODE_SET:
String listenModeStr = data.substring(3, 5);
// update only when listen mode is supported
if (listenModeStr != "N/") {
if (!listenModeStr.equals("N/")) {
int listenMode = Integer.parseInt(listenModeStr, 16);
updateState(CHANNEL_LISTENMODE, new DecimalType(listenMode));
}
Expand All @@ -330,8 +332,10 @@ public void statusUpdateReceived(EventObject event, String ip, String data) {
updateState(CHANNEL_VOLUMEZONE2, new PercentType(Integer.parseInt(data.substring(3, 5), 16)));
break;
case ZONE2_SOURCE_SET:
int inputZone2 = Integer.parseInt(data.substring(3, 5), 16);
updateState(CHANNEL_INPUTZONE2, new DecimalType(inputZone2));
if (!data.substring(3, 5).contentEquals("N/")) {
int inputZone2 = Integer.parseInt(data.substring(3, 5), 16);
updateState(CHANNEL_INPUTZONE2, new DecimalType(inputZone2));
}
break;
default:
logger.debug("Received unhandled status update from Onkyo Receiver @{}: data={}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @author Thomas.Eichstaedt-Engelen
* @author Pauli Anttila
* @author Paul Frank
* @author Marcel Verpaalen
* @since 1.3.0
*/
public enum EiscpCommand {
Expand Down Expand Up @@ -133,8 +134,9 @@ public enum EiscpCommand {
ZONE2_VOLUME_QUERY("ZVLQSTN", EiscpCommandRef.ZONE2_VOLUME_QUERY),
ZONE2_VOLUME_SET("ZVL%02X", EiscpCommandRef.ZONE2_VOLUME_SET),
ZONE2_SET_VOLUME("ZVL%02X", EiscpCommandRef.ZONE2_VOLUME_SET),
ZONE2_VOLUME("ZVL%02X", EiscpCommandRef.ZONE2_VOLUME_SET),
ZONE2_VOLUME("ZVL", EiscpCommandRef.ZONE2_VOLUME_SET),

/* Removed as this prevents lookup of the right source. All sources are captured with "SLZ%02X"
ZONE2_SOURCE_DVR("SLZ00", EiscpCommandRef.ZONE2_SOURCE_DVR),
ZONE2_SOURCE_VCR("SLZ00", EiscpCommandRef.ZONE2_SOURCE_DVR),
ZONE2_SOURCE_SATELLITE("SLZ01", EiscpCommandRef.ZONE2_SOURCE_SATELLITE),
Expand All @@ -159,15 +161,18 @@ public enum EiscpCommand {
ZONE2_SOURCE_INTERNETRADIO("SLZ28", EiscpCommandRef.ZONE2_SOURCE_INTERNETRADIO),
ZONE2_SOURCE_USB("SLZ29", EiscpCommandRef.ZONE2_SOURCE_USB),
ZONE2_SOURCE_USB_BACK("SLZ2A", EiscpCommandRef.ZONE2_SOURCE_USB_BACK),
ZONE2_SOURCE_NETWORK("SLZ2C", EiscpCommandRef.ZONE2_SOURCE_NETWORK),
ZONE2_SOURCE_NETWORK("SLZ2B", EiscpCommandRef.ZONE2_SOURCE_NETWORK),
ZONE2_SOURCE_USB_T("SLZ2C", EiscpCommandRef.ZONE2_SOURCE_USB_T),
ZONE2_SOURCE_MULTICH("SLZ30", EiscpCommandRef.ZONE2_SOURCE_MULTICH),
ZONE2_SOURCE_SIRIUS("SLZ32", EiscpCommandRef.ZONE2_SOURCE_SIRIUS),
ZONE2_SOURCE_SOURCE("SLZ80", EiscpCommandRef.ZONE2_SOURCE_SOURCE),
*/
ZONE2_SOURCE_UP("SLZUP", EiscpCommandRef.ZONE2_SOURCE_UP),
ZONE2_SOURCE_DOWN("SLZDOWN", EiscpCommandRef.ZONE2_SOURCE_DOWN),
ZONE2_SOURCE_QUERY("SLZQSTN", EiscpCommandRef.ZONE2_SOURCE_QUERY),
ZONE2_SOURCE_SET("SLZ%02X", EiscpCommandRef.ZONE2_SOURCE_SET),
ZONE2_SET_SOURCE("SLZ%02X", EiscpCommandRef.ZONE2_SOURCE_SET),
ZONE2_SOURCE("SLZ%02X", EiscpCommandRef.ZONE2_SOURCE_SET),
ZONE2_SOURCE("SLZ", EiscpCommandRef.ZONE2_SOURCE_SET),

/*
* Zone 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ public enum EiscpCommandRef {

SOURCE_SET(162),
ZONE2_SOURCE_SET(163),
ZONE3_SOURCE_SET(163),
SOURCE_GAME2(164),
ZONE3_SOURCE_SET(164),

/**
* NET/USB Play Status QUERY (3 letters - PRS).
Expand Down