Use renamed Units class (#9267)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -31,7 +31,7 @@ import org.openhab.core.library.types.DecimalType;
|
||||
import org.openhab.core.library.types.HSBType;
|
||||
import org.openhab.core.library.types.PointType;
|
||||
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.thing.Bridge;
|
||||
import org.openhab.core.thing.Channel;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
@@ -181,7 +181,7 @@ public class OpenUVReportHandler extends BaseThingHandler {
|
||||
});
|
||||
} else if (ELEVATION.equals(channelUID.getId()) && command instanceof QuantityType) {
|
||||
QuantityType<?> qtty = (QuantityType<?>) command;
|
||||
if (qtty.getUnit() == SmartHomeUnits.DEGREE_ANGLE) {
|
||||
if (qtty.getUnit() == Units.DEGREE_ANGLE) {
|
||||
suspendUpdates = qtty.doubleValue() < 0;
|
||||
} else {
|
||||
logger.info("The OpenUV Report handles Sun Elevation of Number:Angle type, {} does not fit.", command);
|
||||
@@ -218,7 +218,7 @@ public class OpenUVReportHandler extends BaseThingHandler {
|
||||
updateState(channelUID, new DecimalType(openUVData.getUvMax()));
|
||||
break;
|
||||
case OZONE:
|
||||
updateState(channelUID, new QuantityType<>(openUVData.getOzone(), SmartHomeUnits.DOBSON_UNIT));
|
||||
updateState(channelUID, new QuantityType<>(openUVData.getOzone(), Units.DOBSON_UNIT));
|
||||
break;
|
||||
case OZONE_TIME:
|
||||
updateState(channelUID, openUVData.getOzoneTime());
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.library.types.DateTimeType;
|
||||
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;
|
||||
@@ -93,7 +93,7 @@ public class OpenUVResult {
|
||||
FitzpatrickType value = FitzpatrickType.valueOf(index);
|
||||
Integer duration = safeExposureTime.get(value);
|
||||
if (duration != null) {
|
||||
return new QuantityType<>(duration, SmartHomeUnits.MINUTE);
|
||||
return new QuantityType<>(duration, Units.MINUTE);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.warn("Unexpected Fitzpatrick index value '{}' : {}", index, e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user