Use renamed Units class (#9267)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2020-12-07 10:34:02 +01:00
committed by GitHub
parent d0480d0f2e
commit ac6f08908f
208 changed files with 1087 additions and 1169 deletions

View File

@@ -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;

View File

@@ -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: