From 6436cdffb92c7e26d51acb3483d9c87d3c93d177 Mon Sep 17 00:00:00 2001 From: dza1 <58394953+dza1@users.noreply.github.com> Date: Thu, 20 Apr 2023 22:22:38 +0200 Subject: [PATCH] [deconz] Update the roller shutter status (#14827) * [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 --- .../binding/deconz/internal/handler/LightThingHandler.java | 7 ++++++- .../org/openhab/binding/deconz/windowcovering.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java index 8668bc708f..b576a92835 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java @@ -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); } diff --git a/bundles/org.openhab.binding.deconz/src/test/resources/org/openhab/binding/deconz/windowcovering.json b/bundles/org.openhab.binding.deconz/src/test/resources/org/openhab/binding/deconz/windowcovering.json index ddb63490f6..3820c6936b 100644 --- a/bundles/org.openhab.binding.deconz/src/test/resources/org/openhab/binding/deconz/windowcovering.json +++ b/bundles/org.openhab.binding.deconz/src/test/resources/org/openhab/binding/deconz/windowcovering.json @@ -4,7 +4,7 @@ "r": "lights", "state": { "alert": null, - "bri": 102, + "lift": 41, "on": true, "reachable": true }, -- 2.47.3