Skip to content

Commit

Permalink
[rotel] Fix command to select PC USB source (ASCII v2 mode) (openhab#…
Browse files Browse the repository at this point in the history
…10165)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and thinkingstone committed Nov 7, 2021
1 parent 8400961 commit 8638dd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public enum RotelCommand {
SOURCE_VIDEO8("Source Video 8", "video8", "video8"),
SOURCE_PHONO("Source Phono", RotelConnector.PRIMARY_CMD, (byte) 0x35, "phono", "phono"),
SOURCE_USB("Source Front USB", RotelConnector.PRIMARY_CMD, (byte) 0x8E, "usb", "usb"),
SOURCE_PCUSB("Source PC USB", "pc_usb", "pc_usb"),
SOURCE_PCUSB("Source PC USB", "pc_usb", "pcusb"),
SOURCE_MULTI_INPUT("Source Multi Input", RotelConnector.PRIMARY_CMD, (byte) 0x15, "multi_input", "multi_input"),
SOURCE_AUX("Source Aux", "aux", "aux"),
SOURCE_AUX1("Source Aux 1", "aux1", "aux1"),
Expand Down Expand Up @@ -336,9 +336,9 @@ public byte getHexKey() {
*
* @throws RotelException - If no command is associated to the searched textual command
*/
public static RotelCommand getFromAsciiCommandV2(String text) throws RotelException {
public static RotelCommand getFromAsciiCommand(String text) throws RotelException {
for (RotelCommand value : RotelCommand.values()) {
if (text.equals(value.getAsciiCommandV2())) {
if (text.equals(value.getAsciiCommandV1()) || text.equals(value.getAsciiCommandV2())) {
return value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1293,28 +1293,28 @@ public void onNewMessageEvent(EventObject event) {
updateChannelState(CHANNEL_MAIN_TREBLE);
break;
case RotelConnector.KEY_SOURCE:
source = connector.getModel().getSourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
source = connector.getModel().getSourceFromCommand(RotelCommand.getFromAsciiCommand(value));
updateChannelState(CHANNEL_SOURCE);
updateChannelState(CHANNEL_MAIN_SOURCE);
break;
case RotelConnector.KEY_RECORD:
recordSource = connector.getModel()
.getRecordSourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
.getRecordSourceFromCommand(RotelCommand.getFromAsciiCommand(value));
updateChannelState(CHANNEL_MAIN_RECORD_SOURCE);
break;
case RotelConnector.KEY_SOURCE_ZONE2:
sourceZone2 = connector.getModel()
.getZone2SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
.getZone2SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
updateChannelState(CHANNEL_ZONE2_SOURCE);
break;
case RotelConnector.KEY_SOURCE_ZONE3:
sourceZone3 = connector.getModel()
.getZone3SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
.getZone3SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
updateChannelState(CHANNEL_ZONE3_SOURCE);
break;
case RotelConnector.KEY_SOURCE_ZONE4:
sourceZone4 = connector.getModel()
.getZone4SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
.getZone4SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
updateChannelState(CHANNEL_ZONE4_SOURCE);
break;
case RotelConnector.KEY_DSP_MODE:
Expand Down

0 comments on commit 8638dd2

Please sign in to comment.