]> git.basschouten.com Git - openhab-addons.git/commitdiff
[enocean] Fix condition in getPositionData-D2_05_00 (#14558)
authorZhivka Dimova <zhivka.dimova@myforest.net>
Thu, 9 Mar 2023 12:08:36 +0000 (13:08 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Mar 2023 12:08:36 +0000 (13:08 +0100)
Fix #14528

Signed-off-by: Zhivka Dimova <zhivka.dimova@myforest.net>
bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_05/D2_05_00.java

index faaf1bd956d5027548df3da2ae0a14984a159994..972b9e02b9a2c4d80d3576b1601788cd7c9f50c8 100644 (file)
@@ -84,8 +84,9 @@ public class D2_05_00 extends _VLDMessage {
 
     protected State getPositionData() {
         if (getCMD() == CMD_ACTUATOR_POSITION_RESPONE) {
-            if (bytes[0] != 127) {
-                return new PercentType(bytes[0] & 0x7f);
+            int position = bytes[0] & 0x7f;
+            if (position != 127) {
+                return new PercentType(position);
             }
         }