From f2f0f4b40286df09474ab2e7fe325c8f4ebb4b2b Mon Sep 17 00:00:00 2001 From: J-N-K Date: Mon, 17 Apr 2023 21:33:28 +0200 Subject: [PATCH] [map][scale] Fix localization (#14825) 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 --- .../transform/map/internal/MapTransformationService.java | 2 +- .../transform/scale/internal/ScaleTransformationService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java index dab6bb225..61b795365 100644 --- a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java +++ b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java @@ -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); diff --git a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java index bcc493820..b7cf56ace 100644 --- a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java +++ b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java @@ -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;