From 5eecaff637ae681385402fc1dd7107bbd66b64fe Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 25 Dec 2023 15:09:00 +0100 Subject: [PATCH] [jssscripting] Fix JS Quantity to Java QuantityType conversion (#16106) Regression from https://github.com/openhab/openhab-js/pull/312. Signed-off-by: Florian Hotze --- .../jsscripting/internal/OpenhabGraalJSScriptEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java index 1264e9131..04f4e6521 100644 --- a/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java +++ b/bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/OpenhabGraalJSScriptEngine.java @@ -125,8 +125,8 @@ public class OpenhabGraalJSScriptEngine v -> v.getMember("rawItem").as(Item.class), HostAccess.TargetMappingPrecedence.LOW) // Translate openhab-js Quantity to org.openhab.core.library.types.QuantityType - .targetTypeMapping(Value.class, QuantityType.class, v -> v.hasMember("raw") && v.hasMember("toUnit"), - v -> v.getMember("raw").as(QuantityType.class), HostAccess.TargetMappingPrecedence.LOW) + .targetTypeMapping(Value.class, QuantityType.class, v -> v.hasMember("rawQtyType"), + v -> v.getMember("rawQtyType").as(QuantityType.class), HostAccess.TargetMappingPrecedence.LOW) .build(); /** {@link Lock} synchronization of multi-thread access */