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

[OmniLink] Fix OmniLink temperature/humidity sensors #10130

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.omnilink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public void handleCommand(ChannelUID channelUID, Command command) {
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ public void handleCommand(ChannelUID channelUID, Command command) {
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public float omniToFormat(int omniNumber) {
}

@Override
public int formatToOmni(int celsius) {
public int formatToOmni(float celsius) {
return MessageUtils.CToOmni(celsius);
}
},
Expand All @@ -44,7 +44,7 @@ public float omniToFormat(int omniNumber) {
}

@Override
public int formatToOmni(int fahrenheit) {
public int formatToOmni(float fahrenheit) {
return MessageUtils.FtoOmni(fahrenheit);
}
};
Expand All @@ -69,7 +69,7 @@ private TemperatureFormat(int formatNumber) {
* @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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,22 @@ public void handleCommand(ChannelUID channelUID, Command command) {
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:
Expand Down