From f9ee7399ba23aa4f5c200d86e991d820dc0b5ac3 Mon Sep 17 00:00:00 2001 From: mlobstein Date: Sun, 31 Oct 2021 06:40:46 -0500 Subject: [PATCH] [yamahareceiver] Handle 'No Preset' tuner preset response (#11471) Signed-off-by: Michael Lobstein --- .../internal/protocol/xml/InputWithPresetControlXML.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java index eb0a811048ff4..b10abf376fea0 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java @@ -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; }