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

@@ -16,7 +16,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.comfoair.internal.ComfoAirCommandType;
import org.openhab.core.library.types.QuantityType;
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;
import org.slf4j.Logger;
@@ -52,7 +52,7 @@ public class DataTypeTime implements ComfoAirDataType {
return UnDefType.NULL;
}
return new QuantityType<>(value, SmartHomeUnits.HOUR);
return new QuantityType<>(value, Units.HOUR);
}
}
@@ -61,7 +61,7 @@ public class DataTypeTime implements ComfoAirDataType {
int[] template = commandType.getChangeDataTemplate();
int[] possibleValues = commandType.getPossibleValues();
int position = commandType.getChangeDataPos();
QuantityType<?> hours = ((QuantityType<?>) value).toUnit(SmartHomeUnits.HOUR);
QuantityType<?> hours = ((QuantityType<?>) value).toUnit(Units.HOUR);
if (hours != null) {
int intValue = hours.intValue();

View File

@@ -16,7 +16,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.comfoair.internal.ComfoAirCommandType;
import org.openhab.core.library.types.QuantityType;
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;
import org.slf4j.Logger;
@@ -49,7 +49,7 @@ public class DataTypeVolt implements ComfoAirDataType {
} else {
int[] readReplyDataPos = commandType.getReadReplyDataPos();
if (readReplyDataPos != null && readReplyDataPos[0] < data.length) {
return new QuantityType<>((double) data[readReplyDataPos[0]] * 10 / 255, SmartHomeUnits.VOLT);
return new QuantityType<>((double) data[readReplyDataPos[0]] * 10 / 255, Units.VOLT);
} else {
return UnDefType.NULL;
}
@@ -59,7 +59,7 @@ public class DataTypeVolt implements ComfoAirDataType {
@Override
public int @Nullable [] convertFromState(State value, ComfoAirCommandType commandType) {
int[] template = commandType.getChangeDataTemplate();
QuantityType<?> volts = ((QuantityType<?>) value).toUnit(SmartHomeUnits.VOLT);
QuantityType<?> volts = ((QuantityType<?>) value).toUnit(Units.VOLT);
if (volts != null) {
template[commandType.getChangeDataPos()] = (int) (volts.doubleValue() * 255 / 10);