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

@@ -30,7 +30,7 @@ import org.openhab.binding.regoheatpump.internal.protocol.RegoConnection;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.unit.MetricPrefix;
import org.openhab.core.library.unit.SmartHomeUnits;
import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
@@ -188,7 +188,7 @@ abstract class HusdataHandler extends BaseThingHandler {
switch (dataType) {
case 0x00: // Degrees
updateState(channelID, new QuantityType<>(value / 10.0, SmartHomeUnits.DEGREE_ANGLE));
updateState(channelID, new QuantityType<>(value / 10.0, Units.DEGREE_ANGLE));
break;
case 0x02: // Number
@@ -196,27 +196,27 @@ abstract class HusdataHandler extends BaseThingHandler {
break;
case 0x03: // Percent
updateState(channelID, new QuantityType<>(value / 10.0, SmartHomeUnits.PERCENT));
updateState(channelID, new QuantityType<>(value / 10.0, Units.PERCENT));
break;
case 0x04: // Ampere
updateState(channelID, new QuantityType<>(value / 10.0, SmartHomeUnits.AMPERE));
updateState(channelID, new QuantityType<>(value / 10.0, Units.AMPERE));
break;
case 0x05: // kWh
updateState(channelID, new QuantityType<>(value / 10.0, SmartHomeUnits.KILOWATT_HOUR));
updateState(channelID, new QuantityType<>(value / 10.0, Units.KILOWATT_HOUR));
break;
case 0x06: // Hours
updateState(channelID, new QuantityType<>(value, SmartHomeUnits.HOUR));
updateState(channelID, new QuantityType<>(value, Units.HOUR));
break;
case 0x07: // Minutes
updateState(channelID, new QuantityType<>(value, SmartHomeUnits.MINUTE));
updateState(channelID, new QuantityType<>(value, Units.MINUTE));
break;
case 0x09: // kw
updateState(channelID, new QuantityType<>(value, MetricPrefix.KILO(SmartHomeUnits.WATT)));
updateState(channelID, new QuantityType<>(value, MetricPrefix.KILO(Units.WATT)));
break;
case 0x01: // Switch

View File

@@ -20,7 +20,7 @@ import java.util.Map;
import javax.measure.Unit;
import org.openhab.core.library.unit.SIUnits;
import org.openhab.core.library.unit.SmartHomeUnits;
import org.openhab.core.library.unit.Units;
/**
* The {@link RegoRegisterMapper} is responsible for mapping rego 6xx registers into channels.
@@ -81,7 +81,7 @@ public class RegoRegisterMapper {
}
static Channel hours(short address) {
return new ChannelImpl(address, 1, SmartHomeUnits.HOUR) {
return new ChannelImpl(address, 1, Units.HOUR) {
@Override
public int convertValue(short value) {
return Short.toUnsignedInt(value);
@@ -90,7 +90,7 @@ public class RegoRegisterMapper {
}
static Channel percent(short address) {
return new ChannelImpl(address, 0.1, SmartHomeUnits.PERCENT);
return new ChannelImpl(address, 0.1, Units.PERCENT);
}
static Channel unitless(short address, double scaleFactor) {