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

@@ -26,7 +26,7 @@ import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.types.StringType;
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.thing.Channel;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
@@ -88,7 +88,7 @@ public class VerisureClimateDeviceThingHandler extends VerisureThingHandler<Veri
case CHANNEL_HUMIDITY:
if (climateJSON.getData().getInstallation().getClimates().get(0).isHumidityEnabled()) {
double humidity = climateJSON.getData().getInstallation().getClimates().get(0).getHumidityValue();
return new QuantityType<Dimensionless>(humidity, SmartHomeUnits.PERCENT);
return new QuantityType<Dimensionless>(humidity, Units.PERCENT);
}
case CHANNEL_HUMIDITY_ENABLED:
boolean humidityEnabled = climateJSON.getData().getInstallation().getClimates().get(0)

View File

@@ -29,7 +29,7 @@ import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.types.StringType;
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.thing.Channel;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
@@ -99,16 +99,16 @@ public class VerisureMiceDetectionThingHandler extends VerisureThingHandler<Veri
}
case CHANNEL_DURATION_LATEST_DETECTION:
if (mouse.getDetections().size() == 0) {
return new QuantityType<Time>(0, SmartHomeUnits.SECOND);
return new QuantityType<Time>(0, Units.SECOND);
} else {
return new QuantityType<Time>(mouse.getDetections().get(0).getDuration(), SmartHomeUnits.SECOND);
return new QuantityType<Time>(mouse.getDetections().get(0).getDuration(), Units.SECOND);
}
case CHANNEL_DURATION_LAST_24_HOURS:
if (mouse.getDetections().size() == 0) {
return new QuantityType<Time>(0, SmartHomeUnits.SECOND);
return new QuantityType<Time>(0, Units.SECOND);
} else {
return new QuantityType<Time>(mouse.getDetections().stream().mapToInt(Detection::getDuration).sum(),
SmartHomeUnits.SECOND);
Units.SECOND);
}
case CHANNEL_LOCATION:
String location = mouse.getDevice().getArea();