[fineoffsetweatherstation] fix conversion of pressure (#13139)

resolves #13127

Signed-off-by: Andreas Berger <andreas@berger-freelancer.com>
This commit is contained in:
Andreas Berger 2022-07-18 16:16:37 +02:00 committed by GitHub
parent 49a82c284e
commit 7920dd6d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public enum MeasureType {
PERCENTAGE(PERCENT, 1, CHANNEL_TYPE_HUMIDITY, (data, offset) -> toUInt8(data[offset])), PERCENTAGE(PERCENT, 1, CHANNEL_TYPE_HUMIDITY, (data, offset) -> toUInt8(data[offset])),
PRESSURE(HECTO(PASCAL), 2, CHANNEL_TYPE_PRESSURE, Utils::toUInt16), PRESSURE(HECTO(PASCAL), 2, CHANNEL_TYPE_PRESSURE, (data, offset) -> toUInt16(data, offset) / 10.),
DEGREE(DEGREE_ANGLE, 2, null, Utils::toUInt16), DEGREE(DEGREE_ANGLE, 2, null, Utils::toUInt16),

View File

@ -38,7 +38,7 @@ class FineOffsetDataParserTest {
Assertions.assertThat(data) Assertions.assertThat(data)
.extracting(MeasuredValue::getChannelId, measuredValue -> measuredValue.getState().toString()) .extracting(MeasuredValue::getChannelId, measuredValue -> measuredValue.getState().toString())
.containsExactly(new Tuple("temperature-indoor", "21.1 °C"), new Tuple("humidity-indoor", "40 %"), .containsExactly(new Tuple("temperature-indoor", "21.1 °C"), new Tuple("humidity-indoor", "40 %"),
new Tuple("pressure-absolute", "10223 hPa"), new Tuple("pressure-relative", "10223 hPa"), new Tuple("pressure-absolute", "1022.3 hPa"), new Tuple("pressure-relative", "1022.3 hPa"),
new Tuple("temperature-outdoor", "6.9 °C"), new Tuple("humidity-outdoor", "79 %"), new Tuple("temperature-outdoor", "6.9 °C"), new Tuple("humidity-outdoor", "79 %"),
new Tuple("direction-wind", "21 °"), new Tuple("speed-wind", "0 m/s"), new Tuple("direction-wind", "21 °"), new Tuple("speed-wind", "0 m/s"),
new Tuple("speed-gust", "0 m/s"), new Tuple("illumination", "0 lx"), new Tuple("speed-gust", "0 m/s"), new Tuple("illumination", "0 lx"),