[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:
parent
4495c53f7e
commit
fe496c7389
|
@ -87,7 +87,7 @@ public enum RotelCommand {
|
||||||
SOURCE_VIDEO8("Source Video 8", "video8", "video8"),
|
SOURCE_VIDEO8("Source Video 8", "video8", "video8"),
|
||||||
SOURCE_PHONO("Source Phono", RotelConnector.PRIMARY_CMD, (byte) 0x35, "phono", "phono"),
|
SOURCE_PHONO("Source Phono", RotelConnector.PRIMARY_CMD, (byte) 0x35, "phono", "phono"),
|
||||||
SOURCE_USB("Source Front USB", RotelConnector.PRIMARY_CMD, (byte) 0x8E, "usb", "usb"),
|
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_MULTI_INPUT("Source Multi Input", RotelConnector.PRIMARY_CMD, (byte) 0x15, "multi_input", "multi_input"),
|
||||||
SOURCE_AUX("Source Aux", "aux", "aux"),
|
SOURCE_AUX("Source Aux", "aux", "aux"),
|
||||||
SOURCE_AUX1("Source Aux 1", "aux1", "aux1"),
|
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
|
* @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()) {
|
for (RotelCommand value : RotelCommand.values()) {
|
||||||
if (text.equals(value.getAsciiCommandV2())) {
|
if (text.equals(value.getAsciiCommandV1()) || text.equals(value.getAsciiCommandV2())) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1293,28 +1293,28 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL
|
||||||
updateChannelState(CHANNEL_MAIN_TREBLE);
|
updateChannelState(CHANNEL_MAIN_TREBLE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_SOURCE:
|
case RotelConnector.KEY_SOURCE:
|
||||||
source = connector.getModel().getSourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
|
source = connector.getModel().getSourceFromCommand(RotelCommand.getFromAsciiCommand(value));
|
||||||
updateChannelState(CHANNEL_SOURCE);
|
updateChannelState(CHANNEL_SOURCE);
|
||||||
updateChannelState(CHANNEL_MAIN_SOURCE);
|
updateChannelState(CHANNEL_MAIN_SOURCE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_RECORD:
|
case RotelConnector.KEY_RECORD:
|
||||||
recordSource = connector.getModel()
|
recordSource = connector.getModel()
|
||||||
.getRecordSourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
|
.getRecordSourceFromCommand(RotelCommand.getFromAsciiCommand(value));
|
||||||
updateChannelState(CHANNEL_MAIN_RECORD_SOURCE);
|
updateChannelState(CHANNEL_MAIN_RECORD_SOURCE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_SOURCE_ZONE2:
|
case RotelConnector.KEY_SOURCE_ZONE2:
|
||||||
sourceZone2 = connector.getModel()
|
sourceZone2 = connector.getModel()
|
||||||
.getZone2SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
|
.getZone2SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
|
||||||
updateChannelState(CHANNEL_ZONE2_SOURCE);
|
updateChannelState(CHANNEL_ZONE2_SOURCE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_SOURCE_ZONE3:
|
case RotelConnector.KEY_SOURCE_ZONE3:
|
||||||
sourceZone3 = connector.getModel()
|
sourceZone3 = connector.getModel()
|
||||||
.getZone3SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
|
.getZone3SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
|
||||||
updateChannelState(CHANNEL_ZONE3_SOURCE);
|
updateChannelState(CHANNEL_ZONE3_SOURCE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_SOURCE_ZONE4:
|
case RotelConnector.KEY_SOURCE_ZONE4:
|
||||||
sourceZone4 = connector.getModel()
|
sourceZone4 = connector.getModel()
|
||||||
.getZone4SourceFromCommand(RotelCommand.getFromAsciiCommandV2(value));
|
.getZone4SourceFromCommand(RotelCommand.getFromAsciiCommand(value));
|
||||||
updateChannelState(CHANNEL_ZONE4_SOURCE);
|
updateChannelState(CHANNEL_ZONE4_SOURCE);
|
||||||
break;
|
break;
|
||||||
case RotelConnector.KEY_DSP_MODE:
|
case RotelConnector.KEY_DSP_MODE:
|
||||||
|
|
Loading…
Reference in New Issue