From 1aba0401ebfdcf63046d62d7dad66500e4f72413 Mon Sep 17 00:00:00 2001 From: Rosi2143 Date: Tue, 17 Dec 2019 08:21:38 +0100 Subject: [PATCH] [homematic] make lookup table for device description case insensitive(#6525) (#6530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make all keys uppercase and also seach for uppercase keys only this way it does not matter if keys contain HmIP or HMIP strings. Signed-off-by: Michael Roßner --- .../binding/homematic/internal/type/MetadataUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java index 45940748db527..ccbc42b67f1ac 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java @@ -62,7 +62,7 @@ protected static void initialize() { private static void loadBundle(String filename) { descriptionsBundle = ResourceBundle.getBundle(filename, Locale.getDefault()); for (String key : descriptionsBundle.keySet()) { - descriptions.put(key, descriptionsBundle.getString(key)); + descriptions.put(key.toUpperCase(), descriptionsBundle.getString(key)); } ResourceBundle.clearCache(); descriptionsBundle = null; @@ -200,7 +200,7 @@ public static String getDescription(String... keys) { if (key.endsWith("|")) { key = key.substring(0, key.length() - 1); } - String description = descriptions.get(key); + String description = descriptions.get(key.toUpperCase()); if (description != null) { return description; }