Skip to content

Commit

Permalink
fix decimal values being truncated (openhab#10989)
Browse files Browse the repository at this point in the history
Signed-off-by: dw-8 <davy.wong.on+github@gmail.com>
  • Loading branch information
sibbi77 authored and dw-8 committed Jul 25, 2021
1 parent 21242ac commit d3f281c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
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 {
Expand Down

0 comments on commit d3f281c

Please sign in to comment.