Fix setpoint parsing error (#11635)

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
mlobstein
2021-11-23 06:18:30 -06:00
committed by GitHub
parent 860244b18b
commit 43ff86c1b4
3 changed files with 19 additions and 18 deletions

View File

@@ -35,10 +35,10 @@ public class RadioThermostatTstatDTO {
private Integer programMode;
@SerializedName("t_heat")
private Integer heatTarget;
private Double heatTarget;
@SerializedName("t_cool")
private Integer coolTarget;
private Double coolTarget;
@SerializedName("override")
private Integer override;
@@ -86,19 +86,19 @@ public class RadioThermostatTstatDTO {
this.programMode = programMode;
}
public Integer getHeatTarget() {
public Double getHeatTarget() {
return heatTarget;
}
public void setHeatTarget(Integer heatTarget) {
public void setHeatTarget(Double heatTarget) {
this.heatTarget = heatTarget;
}
public Integer getCoolTarget() {
public Double getCoolTarget() {
return coolTarget;
}
public void setCoolTarget(Integer coolTarget) {
public void setCoolTarget(Double coolTarget) {
this.coolTarget = coolTarget;
}
@@ -129,9 +129,9 @@ public class RadioThermostatTstatDTO {
*/
public Integer getSetpoint() {
if (mode == 1) {
return heatTarget;
return heatTarget.intValue();
} else if (mode == 2) {
return coolTarget;
return coolTarget.intValue();
} else {
return 0;
}

View File

@@ -233,7 +233,8 @@ public class RadioThermostatHandler extends BaseThingHandler implements RadioThe
};
logRefreshJob = null;
this.logRefreshJob = scheduler.scheduleWithFixedDelay(runnable, 1, logRefreshPeriod, TimeUnit.MINUTES);
this.logRefreshJob = scheduler.scheduleWithFixedDelay(runnable, (!this.clockSync ? 1 : 2), logRefreshPeriod,
TimeUnit.MINUTES);
}
}
@@ -289,8 +290,8 @@ public class RadioThermostatHandler extends BaseThingHandler implements RadioThe
// set the new operating mode, reset everything else,
// because refreshing the tstat data below is really slow.
rthermData.getThermostatData().setMode(cmdInt);
rthermData.getThermostatData().setHeatTarget(0);
rthermData.getThermostatData().setCoolTarget(0);
rthermData.getThermostatData().setHeatTarget(Double.valueOf(0));
rthermData.getThermostatData().setCoolTarget(Double.valueOf(0));
updateChannel(SET_POINT, rthermData);
rthermData.getThermostatData().setHold(0);
updateChannel(HOLD, rthermData);
@@ -323,10 +324,10 @@ public class RadioThermostatHandler extends BaseThingHandler implements RadioThe
String cmdKey = null;
if (rthermData.getThermostatData().getMode() == 1) {
cmdKey = this.setpointCmdKeyPrefix + "heat";
rthermData.getThermostatData().setHeatTarget(cmdInt);
rthermData.getThermostatData().setHeatTarget(Double.valueOf(cmdInt));
} else if (rthermData.getThermostatData().getMode() == 2) {
cmdKey = this.setpointCmdKeyPrefix + "cool";
rthermData.getThermostatData().setCoolTarget(cmdInt);
rthermData.getThermostatData().setCoolTarget(Double.valueOf(cmdInt));
} else {
// don't do anything if we are not in heat or cool mode
break;