From 7cd46447e2f89d8ffb05f6ae9e5a483d9039b294 Mon Sep 17 00:00:00 2001 From: Christian Oeing Date: Mon, 2 Nov 2020 21:11:35 +0100 Subject: [PATCH] #14 Check if StopMoveType is STOP in ShutterControlHandler before setting the device state Signed-off-by: Christian Oeing --- .../devices/shuttercontrol/ShutterControlHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java index ceaed524efc1d..0ab195a54090d 100644 --- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java +++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java @@ -81,10 +81,13 @@ public void handleCommand(ChannelUID channelUID, Command command) { } this.shutterControlService.setState(state); } else if (command instanceof StopMoveType) { - // Set STOPPED operation state - ShutterControlServiceState state = new ShutterControlServiceState(); - state.operationState = OperationState.STOPPED; - this.shutterControlService.setState(state); + StopMoveType stopMoveType = (StopMoveType) command; + if (stopMoveType == StopMoveType.STOP) { + // Set STOPPED operation state + ShutterControlServiceState state = new ShutterControlServiceState(); + state.operationState = OperationState.STOPPED; + this.shutterControlService.setState(state); + } } else if (command instanceof PercentType) { // Set specific level PercentType percentType = (PercentType) command;