Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enocean] Fix temperature values for D2_50 eep #16975

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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