From: lolodomo Date: Sat, 28 Nov 2020 05:30:24 +0000 (+0100) Subject: [remoteopenhab] Accept Decimal state for items of type Number with a dimension (... X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=7130886d220e2296c0b4f1d9e3f00684f6367e44;p=openhab-addons.git [remoteopenhab] Accept Decimal state for items of type Number with a dimension (#9151) Signed-off-by: Laurent Garnier --- 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 b9744f3dc1..b6324ca66c 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) {