Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed Jun 13, 2024
1 parent 3cad012 commit b27a178
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public Command parseCommand(Command command) throws IllegalArgumentException {
}
// items with units specified in the label in the UI but no unit on mqtt are stored as
// DecimalType to avoid conversions (e.g. % expects 0-1 rather than 0-100)
Unit<?> unit = this.unit;
if (unit != null) {
return new QuantityType<>(newValue, unit);
} else {
Expand Down Expand Up @@ -146,6 +147,7 @@ private BigDecimal getOldValue() {

private BigDecimal getQuantityTypeAsDecimal(QuantityType<?> qType) {
BigDecimal val = qType.toBigDecimal();
Unit<?> unit = this.unit;
if (unit != null) {
QuantityType<?> convertedType = qType.toInvertibleUnit(unit);
if (convertedType != null) {
Expand Down

0 comments on commit b27a178

Please sign in to comment.