fix decimal values being truncated (#10989)

This commit is contained in:
Sebastian Held 2021-07-18 19:15:15 +02:00 committed by GitHub
parent 4cf8b1a5ab
commit 8c6c97e237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,8 +119,7 @@ public class EcoTouchHandler extends BaseThingHandler {
QuantityType<?> value = (QuantityType<?>) command;
QuantityType<?> rawUnit = value.toUnit(ecoTouchTag.getUnit());
if (rawUnit != null) {
int raw = rawUnit.intValue();
raw *= ecoTouchTag.getDivisor();
int raw = (int) (rawUnit.doubleValue() * ecoTouchTag.getDivisor());
localConnector.setValue(ecoTouchTag.getTagName(), raw);
}
} else {