]> git.basschouten.com Git - openhab-addons.git/commitdiff
[fineoffsetweatherstation] fix conversion of pressure (#13139)
authorAndreas Berger <Andy2003@users.noreply.github.com>
Mon, 18 Jul 2022 14:16:37 +0000 (16:16 +0200)
committerGitHub <noreply@github.com>
Mon, 18 Jul 2022 14:16:37 +0000 (16:16 +0200)
resolves #13127

Signed-off-by: Andreas Berger <andreas@berger-freelancer.com>
bundles/org.openhab.binding.fineoffsetweatherstation/src/main/java/org/openhab/binding/fineoffsetweatherstation/internal/domain/MeasureType.java
bundles/org.openhab.binding.fineoffsetweatherstation/src/test/java/org/openhab/binding/fineoffsetweatherstation/internal/service/FineOffsetDataParserTest.java

index 075c34c9e01294e47d0bb88793d405d9ab107903..36d16e0d685b2f184bef8f8b9c9521b1b5c4ea94 100644 (file)
@@ -72,7 +72,7 @@ public enum MeasureType {
 
     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),
 
index 269e5d4f24b555a1609acc1e8882c9b48574aac7..f08356b280f24fe837fc581d64d03ba1adcc7333 100644 (file)
@@ -38,7 +38,7 @@ class FineOffsetDataParserTest {
         Assertions.assertThat(data)
                 .extracting(MeasuredValue::getChannelId, measuredValue -> measuredValue.getState().toString())
                 .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("direction-wind", "21 °"), new Tuple("speed-wind", "0 m/s"),
                         new Tuple("speed-gust", "0 m/s"), new Tuple("illumination", "0 lx"),