]> git.basschouten.com Git - openhab-addons.git/commitdiff
[homekit] Allow Long type in configuration for numbers (#13509)
authorCody Cutrer <cody@cutrer.us>
Sun, 9 Oct 2022 07:04:06 +0000 (01:04 -0600)
committerGitHub <noreply@github.com>
Sun, 9 Oct 2022 07:04:06 +0000 (09:04 +0200)
I.e. if it's set from a Ruby script

Signed-off-by: Cody Cutrer <cody@cutrer.us>
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java

index 522b063d13549078f06dc8cd7f2e8c658a82e31c..0ba3c2e6363195862c68151e78e757196a620612 100644 (file)
@@ -295,6 +295,12 @@ public class HomekitTaggedItem {
                 if ((value instanceof Double) && (defaultValue instanceof BigDecimal)) {
                     return (T) BigDecimal.valueOf(((Double) value).doubleValue());
                 }
+                if ((value instanceof Long) && (defaultValue instanceof Double)) {
+                    return (T) Double.valueOf((Long) value);
+                }
+                if ((value instanceof Long) && (defaultValue instanceof BigDecimal)) {
+                    return (T) BigDecimal.valueOf((Long) value);
+                }
             }
 
         }