From 95a486c8a8d92ae9b65121627d5fe0173bb45700 Mon Sep 17 00:00:00 2001 From: HALLO01 <68531310+HALLO01@users.noreply.github.com> Date: Thu, 30 Jul 2020 23:02:30 +0200 Subject: [PATCH] [loxone] fix rollershutter behaviour with alexa integration (#8225) Closes #8157 Signed-off-by: HALLO01 <68531310+HALLO01@users.noreply.github.com> Signed-off-by: Daan Meijer --- .../loxone/internal/controls/LxControlJalousie.java | 9 ++++++++- .../loxone/internal/controls/LxControlJalousieTest.java | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java index 42f0a1e76ac10..ac057f9c59ad8 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java @@ -131,8 +131,15 @@ public void initialize(LxControlConfig config) { } private void handleOperateCommands(Command command) throws IOException { + logger.debug("Command input {}", command); if (command instanceof PercentType) { - moveToPosition(((PercentType) command).doubleValue() / 100); + if (PercentType.ZERO.equals(command)) { + sendAction(CMD_FULL_UP); + } else if (PercentType.HUNDRED.equals(command)) { + sendAction(CMD_FULL_DOWN); + } else { + moveToPosition(((PercentType) command).doubleValue() / 100); + } } else if (command instanceof UpDownType) { if ((UpDownType) command == UpDownType.UP) { sendAction(CMD_FULL_UP); diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java index 09c2d31d9678e..2e9d828c7f260 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java @@ -181,7 +181,7 @@ public void testMovingToPosition() { changeLoxoneState("position", 0.80); testAction(null); changeLoxoneState("position", 1.00); - testAction("Stop"); + testAction(null); changeLoxoneState("down", 0.0); executeCommand(ROLLERSHUTTER_CHANNEL, PercentType.ZERO); @@ -191,7 +191,7 @@ public void testMovingToPosition() { changeLoxoneState("position", 0.20); testAction(null); changeLoxoneState("position", 0.00); - testAction("Stop"); + testAction(null); changeLoxoneState("up", 0.0); } }