]> git.basschouten.com Git - openhab-addons.git/commitdiff
[homekit] handle NULL/UNDEF for temperature characteristics (#12172)
authorCody Cutrer <cody@cutrer.us>
Sun, 30 Jan 2022 17:46:56 +0000 (10:46 -0700)
committerGitHub <noreply@github.com>
Sun, 30 Jan 2022 17:46:56 +0000 (18:46 +0100)
recent regression from handling QuantityType

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

index a7a9de2aadb6b30a5a7d695e342bee4d95d74740..4367611823c0203000effcf49026c631a4c1ea18 100644 (file)
@@ -262,7 +262,7 @@ public class HomekitCharacteristicFactory {
     }
 
     public static @Nullable Double stateAsTemperature(@Nullable State state) {
-        if (state == null) {
+        if (state == null || state instanceof UnDefType) {
             return null;
         }