]> git.basschouten.com Git - openhab-addons.git/commitdiff
[lcn] Fix status message of RollerShutter inverting (#8735)
authorFabian Wolter <github@fabian-wolter.de>
Sun, 18 Oct 2020 18:39:42 +0000 (20:39 +0200)
committerGitHub <noreply@github.com>
Sun, 18 Oct 2020 18:39:42 +0000 (11:39 -0700)
* [lcn] Fix status message of RollerShutter inverting

The status of RollerShutter was not inverted when invertUpDown=true. Fixes #8680

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/LcnModuleHandler.java

index fe1e41985ecb582006a4520210f1bf782761e18c..4c1462963aea9f12de390ad52e1329819a6ec935 100644 (file)
@@ -112,7 +112,8 @@ public class LcnModuleHandler extends BaseThingHandler {
             for (Channel channel : thing.getChannels()) {
                 Object unitObject = channel.getConfiguration().get("unit");
                 Object parameterObject = channel.getConfiguration().get("parameter");
-                Object invertConfig = channel.getConfiguration().get("invertState");
+                Object invertState = channel.getConfiguration().get("invertState");
+                Object invertUpDown = channel.getConfiguration().get("invertUpDown");
 
                 // Initialize value converters
                 if (unitObject instanceof String) {
@@ -130,7 +131,7 @@ public class LcnModuleHandler extends BaseThingHandler {
                 }
 
                 // Initialize inversion converter
-                if (invertConfig instanceof Boolean && invertConfig.equals(true)) {
+                if (Boolean.TRUE.equals(invertState) || Boolean.TRUE.equals(invertUpDown)) {
                     converters.put(channel.getUID(), INVERSION_CONVERTER);
                 }