mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[yamahareceiver] Handle 'No Preset' tuner preset response (#11471)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
edd3e01c64
commit
f9ee7399ba
@ -153,7 +153,8 @@ public class InputWithPresetControlXML extends AbstractInputControlXML implement
|
||||
// special handling for RX-V3900, where 'A1' becomes 101 and 'B2' becomes 202 preset
|
||||
if (presetValue.length() >= 2) {
|
||||
Character presetAlpha = presetValue.charAt(0);
|
||||
if (Character.isLetter(presetAlpha) && Character.isUpperCase(presetAlpha)) {
|
||||
if (Character.isLetter(presetAlpha) && Character.isUpperCase(presetAlpha)
|
||||
&& Character.isDigit(presetValue.charAt(1))) {
|
||||
int presetNumber = Integer.parseInt(presetValue.substring(1));
|
||||
return (ArrayUtils.indexOf(LETTERS, presetAlpha) + 1) * 100 + presetNumber;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user