mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[jssscripting] Fix JS Quantity to Java QuantityType conversion (#16106)
Regression from https://github.com/openhab/openhab-js/pull/312. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This commit is contained in:
parent
891ea04a3b
commit
20a6eee4b5
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user