[yamahareceiver] Handle 'No Preset' tuner preset response (#11471)

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
mlobstein 2021-10-31 06:40:46 -05:00 committed by GitHub
parent edd3e01c64
commit f9ee7399ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}