Skip to content

Commit

Permalink
[enocean] fix temperature values for D2_50 eep (openhab#16975)
Browse files Browse the repository at this point in the history
Fixes openhab#16974

Signed-off-by: Zhivka Dimova <[email protected]>
  • Loading branch information
lovery authored Jul 13, 2024
1 parent a5a02a1 commit 35add30
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,20 @@ protected State convertToStateImpl(String channelId, String channelTypeId,
case CHANNEL_AIRQUALITYVALUE2:
return new QuantityType<>((bytes[4] & 0x7f), Units.PERCENT);
case CHANNEL_OUTDOORAIRTEMPERATURE:
return new QuantityType<>(-63 + (bytes[5] >>> 1), SIUnits.CELSIUS);
return new QuantityType<>(-63 + ((bytes[5] & 0xff) >>> 1), SIUnits.CELSIUS);
case CHANNEL_SUPPLYAIRTEMPERATURE:
return new QuantityType<>(-63 + (bytes[6] >>> 2) + ((bytes[5] & 1) << 6), SIUnits.CELSIUS);
return new QuantityType<>(-63 + ((bytes[6] & 0xff) >>> 2) + ((bytes[5] & 1) << 6), SIUnits.CELSIUS);
case CHANNEL_INDOORAIRTEMPERATURE:
return new QuantityType<>(-63 + (bytes[7] >>> 3) + ((bytes[6] & 0b11) << 5), SIUnits.CELSIUS);
return new QuantityType<>(-63 + ((bytes[7] & 0xff) >>> 3) + ((bytes[6] & 0b11) << 5), SIUnits.CELSIUS);
case CHANNEL_EXHAUSTAIRTEMPERATURE:
return new QuantityType<>(-63 + (bytes[8] >>> 4) + ((bytes[7] & 0b111) << 4), SIUnits.CELSIUS);
return new QuantityType<>(-63 + ((bytes[8] & 0xff) >>> 4) + ((bytes[7] & 0b111) << 4), SIUnits.CELSIUS);
case CHANNEL_SUPPLYAIRFANAIRFLOWRATE:
return new QuantityType<>((bytes[9] >>> 2) + ((bytes[8] & 0b1111) << 6), Units.CUBICMETRE_PER_MINUTE);
return new QuantityType<>(((bytes[9] & 0xff) >>> 2) + ((bytes[8] & 0b1111) << 6),
Units.CUBICMETRE_PER_MINUTE);
case CHANNEL_EXHAUSTAIRFANAIRFLOWRATE:
return new QuantityType<>((bytes[10] & 0xff) + ((bytes[9] & 0b11) << 8), Units.CUBICMETRE_PER_MINUTE);
case CHANNEL_SUPPLYFANSPEED:
return new DecimalType((bytes[12] >>> 4) + (bytes[11] << 4));
return new DecimalType(((bytes[12] & 0xff) >>> 4) + (bytes[11] << 4));
case CHANNEL_EXHAUSTFANSPEED:
return new DecimalType((bytes[13] & 0xff) + ((bytes[12] & 0b1111) << 8));
}
Expand Down

0 comments on commit 35add30

Please sign in to comment.