Use renamed Units class (#9267)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.openhab.binding.bticinosmarther.internal.api.exception.SmartherIllegalPropertyValueException;
|
||||
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.library.unit.Units;
|
||||
|
||||
/**
|
||||
* The {@code Enums} class represents a container for enums related to Smarther API.
|
||||
@@ -175,7 +175,7 @@ public class Enums {
|
||||
return CELSIUS;
|
||||
} else if (unit == ImperialUnits.FAHRENHEIT) {
|
||||
return FAHRENHEIT;
|
||||
} else if (unit == SmartHomeUnits.PERCENT) {
|
||||
} else if (unit == Units.PERCENT) {
|
||||
return PERCENTAGE;
|
||||
} else {
|
||||
return DIMENSIONLESS;
|
||||
|
||||
@@ -24,7 +24,7 @@ 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.library.unit.Units;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.types.UnDefType;
|
||||
|
||||
@@ -100,8 +100,7 @@ public class Measure {
|
||||
.orElse(UnDefType.UNDEF);
|
||||
break;
|
||||
case PERCENTAGE:
|
||||
state = optValue
|
||||
.<State> map(t -> new QuantityType<Dimensionless>(new DecimalType(t), SmartHomeUnits.PERCENT))
|
||||
state = optValue.<State> map(t -> new QuantityType<Dimensionless>(new DecimalType(t), Units.PERCENT))
|
||||
.orElse(UnDefType.UNDEF);
|
||||
break;
|
||||
case DIMENSIONLESS:
|
||||
|
||||
Reference in New Issue
Block a user