Skip to content

Commit

Permalink
[homematic] make lookup table for device description case insensitive(o…
Browse files Browse the repository at this point in the history
…penhab#6525) (openhab#6530)

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 <[email protected]>
  • Loading branch information
Rosi2143 authored and ramack committed May 31, 2020
1 parent 92a2a60 commit 1aba040
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1aba040

Please sign in to comment.