[enocean] Fix condition in getPositionData-D2_05_00 (#14558)

Fix #14528

Signed-off-by: Zhivka Dimova <zhivka.dimova@myforest.net>
This commit is contained in:
Zhivka Dimova 2023-03-09 13:08:36 +01:00 committed by GitHub
parent cc51400bbd
commit 4069d854fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);
}
}