Skip to content

Commit

Permalink
[ecobee] Increase temperature precision to decimal (openhab#14517)
Browse files Browse the repository at this point in the history
* Update EcobeeUtils.java

Correcting rounding of setHold values so we have 0.1°F tolerance instead of 1°F.  Makes it easier to use in °C

Signed-off-by: darthbevis <darthbevis@gmail.com>
Signed-off-by: miloit <MichaelLoercher@web.de>
  • Loading branch information
darthbevis authored and miloit committed Mar 10, 2023
1 parent 986cf55 commit 8fae942
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static Integer convertQuantityTypeToEcobeeTemp(Object value) {
QuantityType<Temperature> convertedTemp = ((QuantityType<Temperature>) value)
.toUnit(ImperialUnits.FAHRENHEIT);
if (convertedTemp != null) {
return Integer.valueOf(convertedTemp.intValue() * 10);
return Integer.valueOf((int) (convertedTemp.doubleValue() * 10));
}
}
throw new IllegalArgumentException("temperature is not a QuantityType");
Expand Down

0 comments on commit 8fae942

Please sign in to comment.