mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +01:00
fix decimal values being truncated (#10989)
This commit is contained in:
parent
4cf8b1a5ab
commit
8c6c97e237
@ -119,8 +119,7 @@ public class EcoTouchHandler extends BaseThingHandler {
|
|||||||
QuantityType<?> value = (QuantityType<?>) command;
|
QuantityType<?> value = (QuantityType<?>) command;
|
||||||
QuantityType<?> rawUnit = value.toUnit(ecoTouchTag.getUnit());
|
QuantityType<?> rawUnit = value.toUnit(ecoTouchTag.getUnit());
|
||||||
if (rawUnit != null) {
|
if (rawUnit != null) {
|
||||||
int raw = rawUnit.intValue();
|
int raw = (int) (rawUnit.doubleValue() * ecoTouchTag.getDivisor());
|
||||||
raw *= ecoTouchTag.getDivisor();
|
|
||||||
localConnector.setValue(ecoTouchTag.getTagName(), raw);
|
localConnector.setValue(ecoTouchTag.getTagName(), raw);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user