]> git.basschouten.com Git - openhab-addons.git/commitdiff
[remoteopenhab] Accept Decimal state for items of type Number with a dimension (...
authorlolodomo <lg.hc@free.fr>
Sat, 28 Nov 2020 05:30:24 +0000 (06:30 +0100)
committerGitHub <noreply@github.com>
Sat, 28 Nov 2020 05:30:24 +0000 (21:30 -0800)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java

index b9744f3dc1f46e9b94d201aefe4205af20ee5e21..b6324ca66c7b9a0303a803efa17bfafe4026b093 100644 (file)
@@ -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<Class<? extends State>> 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) {