From 7130886d220e2296c0b4f1d9e3f00684f6367e44 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sat, 28 Nov 2020 06:30:24 +0100 Subject: [PATCH] [remoteopenhab] Accept Decimal state for items of type Number with a dimension (#9151) Signed-off-by: Laurent Garnier --- .../internal/handler/RemoteopenhabBridgeHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java index b9744f3dc..b6324ca66 100644 --- a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java +++ b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java @@ -463,9 +463,13 @@ public class RemoteopenhabBridgeHandler extends BaseBridgeHandler } } else if (acceptedItemType.startsWith(CoreItemFactory.NUMBER + ":")) { // Item type Number with dimension - if (checkStateType(itemName, stateType, "Quantity")) { + if (stateType == null || "Quantity".equals(stateType)) { List> stateTypes = Collections.singletonList(QuantityType.class); channelState = TypeParser.parseState(stateTypes, state); + } else if ("Decimal".equals(stateType)) { + channelState = new DecimalType(state); + } else { + logger.debug("Unexpected value type {} for item {}", stateType, itemName); } } else { switch (acceptedItemType) {