Skip to content

Commit

Permalink
[yamahareceiver] Handle 'No Preset' tuner preset response (#11471)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Lobstein <[email protected]>
  • Loading branch information
mlobstein authored Oct 31, 2021
1 parent edd3e01 commit f9ee739
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ private int convertToPresetNumber(String presetValue) {
// 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;
}
Expand Down

0 comments on commit f9ee739

Please sign in to comment.