[rotel] Fix command to select PC USB source (ASCII v2 mode) (#10165)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2021-02-17 11:38:27 +01:00 committed by GitHub
parent 4495c53f7e
commit fe496c7389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -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"),
@ -336,9 +336,9 @@ public enum RotelCommand {
*
* @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;
}
}

View File

@ -1293,28 +1293,28 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
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: