]> git.basschouten.com Git - openhab-addons.git/commitdiff
[OmniLink] Fix OmniLink temperature/humidity sensors (#10130)
authorEthan Dye <mrtops03@gmail.com>
Tue, 16 Feb 2021 20:48:07 +0000 (13:48 -0700)
committerGitHub <noreply@github.com>
Tue, 16 Feb 2021 20:48:07 +0000 (12:48 -0800)
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
bundles/org.openhab.binding.omnilink/pom.xml
bundles/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/handler/HumiditySensorHandler.java
bundles/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/handler/TempSensorHandler.java
bundles/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/handler/TemperatureFormat.java
bundles/org.openhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/handler/ThermostatHandler.java

index ee0e2767fb4aee3e107b0a29cde87adb5fcd8cf5..07e400f6ccd16a673d0241f6f7a0aa90de7cb7b8 100644 (file)
@@ -18,7 +18,7 @@
     <dependency>
       <groupId>com.github.digitaldan</groupId>
       <artifactId>jomnilink</artifactId>
-      <version>1.4.0</version>
+      <version>1.4.1</version>
       <scope>compile</scope>
     </dependency>
   </dependencies>
index bda8fe7df61120cce3d72ecb1cb079ae54e6808b..a0751d68b7fa3fde45103d13c0828174bac06e04 100644 (file)
@@ -113,12 +113,12 @@ public class HumiditySensorHandler extends AbstractOmnilinkStatusHandler<Extende
         switch (channelUID.getId()) {
             case CHANNEL_AUX_LOW_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_HEAT_LOW_POINT.getNumber(),
-                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).intValue()),
+                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).floatValue()),
                         thingID);
                 break;
             case CHANNEL_AUX_HIGH_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_COOL_HIGH_POINT.getNumber(),
-                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).intValue()),
+                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).floatValue()),
                         thingID);
                 break;
             default:
index 850e2ad99c4c30dafc61da7abe6f35f0e2c2e539..7152841ae00760f85a6982e80dceff31d9479a38 100644 (file)
@@ -126,12 +126,12 @@ public class TempSensorHandler extends AbstractOmnilinkStatusHandler<ExtendedAux
         switch (channelUID.getId()) {
             case CHANNEL_AUX_LOW_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_HEAT_LOW_POINT.getNumber(),
-                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).intValue()),
+                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).floatValue()),
                         thingID);
                 break;
             case CHANNEL_AUX_HIGH_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_COOL_HIGH_POINT.getNumber(),
-                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).intValue()),
+                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).floatValue()),
                         thingID);
                 break;
             default:
index 8379e0dfb2ef68de6473c6e66669652f7d7a4ce1..fdff35def4a48462b542e14e9061644fcb510199 100644 (file)
@@ -33,7 +33,7 @@ public enum TemperatureFormat {
         }
 
         @Override
-        public int formatToOmni(int celsius) {
+        public int formatToOmni(float celsius) {
             return MessageUtils.CToOmni(celsius);
         }
     },
@@ -44,7 +44,7 @@ public enum TemperatureFormat {
         }
 
         @Override
-        public int formatToOmni(int fahrenheit) {
+        public int formatToOmni(float fahrenheit) {
             return MessageUtils.FtoOmni(fahrenheit);
         }
     };
@@ -69,7 +69,7 @@ public enum TemperatureFormat {
      * @param format Number in the current format.
      * @return Omni formatted number.
      */
-    public abstract int formatToOmni(int format);
+    public abstract int formatToOmni(float format);
 
     /**
      * Get the number which identifies this format as defined by the omniprotocol.
index 37fb57f2f7a6deffe857afb86d24dc1b7288a0fe..f5daccab31857e66a43bc318b1ff01b10d2e0ee1 100644 (file)
@@ -157,22 +157,22 @@ public class ThermostatHandler extends AbstractOmnilinkStatusHandler<ExtendedThe
                 break;
             case CHANNEL_THERMO_HEAT_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_HEAT_LOW_POINT.getNumber(),
-                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).intValue()),
+                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).floatValue()),
                         thingID);
                 break;
             case CHANNEL_THERMO_COOL_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_COOL_HIGH_POINT.getNumber(),
-                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).intValue()),
+                        temperatureFormat.get().formatToOmni(((QuantityType<Temperature>) command).floatValue()),
                         thingID);
                 break;
             case CHANNEL_THERMO_HUMIDIFY_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_HUMDIFY_POINT.getNumber(),
-                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).intValue()),
+                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).floatValue()),
                         thingID);
                 break;
             case CHANNEL_THERMO_DEHUMIDIFY_SETPOINT:
                 sendOmnilinkCommand(OmniLinkCmd.CMD_THERMO_SET_DEHUMIDIFY_POINT.getNumber(),
-                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).intValue()),
+                        TemperatureFormat.FAHRENHEIT.formatToOmni(((QuantityType<Dimensionless>) command).floatValue()),
                         thingID);
                 break;
             default: