]> git.basschouten.com Git - openhab-addons.git/commitdiff
[deconz] Update the roller shutter status (#14827)
authordza1 <58394953+dza1@users.noreply.github.com>
Thu, 20 Apr 2023 20:22:38 +0000 (22:22 +0200)
committerGitHub <noreply@github.com>
Thu, 20 Apr 2023 20:22:38 +0000 (22:22 +0200)
* [deconz] update the roller shutter status (14826)

- if the REST interface from deconz provides a 'lift' value to show
the current position of the roller shutter, it will be used.

Signed-off-by: Daniel Zainzinger <dza1@mailbox.org>
bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java
bundles/org.openhab.binding.deconz/src/test/resources/org/openhab/binding/deconz/windowcovering.json

index 8668bc708fab6b4672396b3127e6ee64b6867298..b576a9283572177bc50c631df9d9ac367a2d7ae2 100644 (file)
@@ -395,7 +395,12 @@ public class LightThingHandler extends DeconzBaseThingHandler {
                     updateState(channelUID, new DecimalType(miredToKelvin(ct)));
                 }
             }
-            case CHANNEL_POSITION -> updatePercentTypeChannel(channelUID, newState.bri, true); // always post value
+            case CHANNEL_POSITION -> {
+                Integer lift = newState.lift;
+                if (lift != null) {
+                    updateState(channelUID, new PercentType(lift));
+                }
+            }
             case CHANNEL_EFFECT -> updateStringChannel(channelUID, newState.effect);
             case CHANNEL_EFFECT_SPEED -> updateDecimalTypeChannel(channelUID, newState.effectSpeed);
         }
index ddb63490f68e161a51e2f54f08f319d5f3eccc5c..3820c6936b917326d1b1749ac1d246f46c0878ce 100644 (file)
@@ -4,7 +4,7 @@
   "r": "lights",
   "state": {
     "alert": null,
-    "bri": 102,
+    "lift": 41,
     "on": true,
     "reachable": true
   },