Use core unit classes (#9261)
Add-ons should not depend on tec.uom.se classes but use core unit classes instead so they are less impacted when this library is replaced or upgraded. Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -24,13 +24,12 @@ import org.openhab.core.library.types.DecimalType;
|
||||
import org.openhab.core.library.types.QuantityType;
|
||||
import org.openhab.core.library.unit.ImperialUnits;
|
||||
import org.openhab.core.library.unit.SIUnits;
|
||||
import org.openhab.core.library.unit.SmartHomeUnits;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.types.UnDefType;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import tec.uom.se.unit.Units;
|
||||
|
||||
/**
|
||||
* The {@code Measure} class defines the dto for Smarther API measure object.
|
||||
*
|
||||
@@ -101,7 +100,8 @@ public class Measure {
|
||||
.orElse(UnDefType.UNDEF);
|
||||
break;
|
||||
case PERCENTAGE:
|
||||
state = optValue.<State> map(t -> new QuantityType<Dimensionless>(new DecimalType(t), Units.PERCENT))
|
||||
state = optValue
|
||||
.<State> map(t -> new QuantityType<Dimensionless>(new DecimalType(t), SmartHomeUnits.PERCENT))
|
||||
.orElse(UnDefType.UNDEF);
|
||||
break;
|
||||
case DIMENSIONLESS:
|
||||
|
||||
Reference in New Issue
Block a user