Skip to content

Commit

Permalink
[loxone] fix rollershutter behaviour with alexa integration (openhab#…
Browse files Browse the repository at this point in the history
…8225)

Closes openhab#8157

Signed-off-by: HALLO01 <[email protected]>
  • Loading branch information
HALLO01 authored and andrewfg committed Aug 31, 2020
1 parent a67aadb commit 724a7e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

0 comments on commit 724a7e0

Please sign in to comment.