]> git.basschouten.com Git - openhab-addons.git/commitdiff
[map][scale] Fix localization (#14825)
authorJ-N-K <github@klug.nrw>
Mon, 17 Apr 2023 19:33:28 +0000 (21:33 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Apr 2023 19:33:28 +0000 (21:33 +0200)
The wrong key was used in the `cachedTransformations` map. Instead of the correctyl localized UID from the registry the provided transformation function was used.

Signed-off-by: Jan N. Klug <github@klug.nrw>
bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java
bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java

index dab6bb22500612f9d9ec296a1cefd2c13705a227..61b795365aae3eda5faf2c95766da7e5cbbe7e02 100644 (file)
@@ -81,7 +81,7 @@ public class MapTransformationService
             if (!cachedTransformations.containsKey(transformation.getUID())) {
                 importConfiguration(transformation);
             }
-            Properties properties = cachedTransformations.get(function);
+            Properties properties = cachedTransformations.get(transformation.getUID());
             if (properties != null) {
                 String target = properties.getProperty(source);
 
index bcc493820f3714caeaa10373075530eee294ae54..b7cf56aceaa7f3fe4aba289445f2b4fd181280a0 100644 (file)
@@ -149,7 +149,7 @@ public class ScaleTransformationService
             if (!cachedTransformations.containsKey(transformation.getUID())) {
                 importConfiguration(transformation);
             }
-            Map<@Nullable Range, String> data = cachedTransformations.get(function);
+            Map<@Nullable Range, String> data = cachedTransformations.get(transformation.getUID());
 
             if (data != null) {
                 String target;