]> git.basschouten.com Git - openhab-addons.git/commitdiff
[danfossairunit] Change Humidity channel type from Number to Number:Dimensionless...
authorjlaur <jacob-github@vindvejr.dk>
Sun, 22 Aug 2021 09:52:05 +0000 (11:52 +0200)
committerGitHub <noreply@github.com>
Sun, 22 Aug 2021 09:52:05 +0000 (11:52 +0200)
* Change Humidity channel from Number to Number:Dimensionless
* Fix documentation for temperature channels.

Fixes #9755

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
bundles/org.openhab.binding.danfossairunit/README.md
bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnit.java
bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/thing/thing-types.xml

index a2b280250e0b31e5b7a4bb73194261b486248356..fecbffced893734fc1450bb8e2b284e5b8b47b44 100644 (file)
@@ -31,10 +31,10 @@ These are the available configuration parameters:
 | extract_fan_step | main | Dimmer | RO | Current step setting of the fan extracting air from the rooms |
 | boost | main | Switch | RW | Enables fan boost  |
 | night_cooling | main | Switch | RW | Enables night cooling  |
-| room_temp | temps | Number | RO | Temperature of the air in the room of the Air Dial  |
-| room_temp_calculated | temps | Number | RO | Calculated Room Temperature  |
-| outdoor_temp | temps | Number | RO | Temperature of the air outside  |
-| humidity | humidity | Number | RO | Humidity  |
+| room_temp | temps | Number:Temperature | RO | Temperature of the air in the room of the Air Dial  |
+| room_temp_calculated | temps | Number:Temperature | RO | Calculated Room Temperature  |
+| outdoor_temp | temps | Number:Temperature | RO | Temperature of the air outside  |
+| humidity | humidity | Number:Dimensionless | RO | Current relative humidity measured by the unit  |
 | bypass | recuperator | Switch | RW | Disables the heat exchange. Useful in summer when room temperature is above target and outside temperature is below target.  |
 | supply_temp | recuperator | Number | RO | Temperature of air which is passed to the rooms  |
 | extract_temp | recuperator | Number | RO | Temperature of the air as extracted from the rooms  |
index c86e00bc6adf3816e366d39f3406e64fc7fe2905..a62b09508df4807a3c5b011cfa4fd2dd42f8459a 100644 (file)
@@ -23,6 +23,7 @@ import java.time.DateTimeException;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
 
+import javax.measure.quantity.Dimensionless;
 import javax.measure.quantity.Temperature;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -33,6 +34,7 @@ import org.openhab.core.library.types.PercentType;
 import org.openhab.core.library.types.QuantityType;
 import org.openhab.core.library.types.StringType;
 import org.openhab.core.library.unit.SIUnits;
+import org.openhab.core.library.unit.Units;
 import org.openhab.core.types.Command;
 
 /**
@@ -191,9 +193,9 @@ public class DanfossAirUnit {
         return getBoolean(REGISTER_1_READ, BYPASS) ? OnOffType.ON : OnOffType.OFF;
     }
 
-    public DecimalType getHumidity() throws IOException {
+    public QuantityType<Dimensionless> getHumidity() throws IOException {
         BigDecimal value = BigDecimal.valueOf(asPercentByte(getByte(REGISTER_1_READ, HUMIDITY)));
-        return new DecimalType(value.setScale(1, RoundingMode.HALF_UP));
+        return new QuantityType<>(value.setScale(1, RoundingMode.HALF_UP), Units.PERCENT);
     }
 
     public QuantityType<Temperature> getRoomTemperature() throws IOException, UnexpectedResponseValueException {
index 8ad223236e894b644b231ece3eb47472df8713b5..d85e4fb08a049e92612a175a2926df1b2c028b88 100644 (file)
@@ -84,7 +84,9 @@
        <channel-group-type id="humidity">
                <label>Humidity</label>
                <channels>
-                       <channel id="humidity" typeId="humidity"/>
+                       <channel id="humidity" typeId="humidity">
+                               <description>Current relative humidity measured by the unit</description>
+                       </channel>
                </channels>
        </channel-group-type>
        <channel-group-type id="recuperator">
                <state pattern="%.0f %%" readOnly="true" min="0" max="100"/>
        </channel-type>
        <channel-type id="humidity">
-               <item-type>Number</item-type>
+               <item-type>Number:Dimensionless</item-type>
                <label>Humidity</label>
                <category>Humidity</category>
                <tags>