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

@@ -28,7 +28,7 @@ import org.openhab.binding.bluetooth.notification.BluetoothScanNotification;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.QuantityType;
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.ChannelUID;
import org.openhab.core.thing.Thing;
@@ -111,19 +111,19 @@ public class RuuviTagHandler extends BeaconBluetoothHandler {
switch (channelUID.getId()) {
case CHANNEL_ID_ACCELERATIONX:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getAccelerationX(), SmartHomeUnits.STANDARD_GRAVITY);
ruuvitagData.getAccelerationX(), Units.STANDARD_GRAVITY);
break;
case CHANNEL_ID_ACCELERATIONY:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getAccelerationY(), SmartHomeUnits.STANDARD_GRAVITY);
ruuvitagData.getAccelerationY(), Units.STANDARD_GRAVITY);
break;
case CHANNEL_ID_ACCELERATIONZ:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getAccelerationZ(), SmartHomeUnits.STANDARD_GRAVITY);
ruuvitagData.getAccelerationZ(), Units.STANDARD_GRAVITY);
break;
case CHANNEL_ID_BATTERY:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getBatteryVoltage(), SmartHomeUnits.VOLT);
ruuvitagData.getBatteryVoltage(), Units.VOLT);
break;
case CHANNEL_ID_DATA_FORMAT:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
@@ -131,15 +131,15 @@ public class RuuviTagHandler extends BeaconBluetoothHandler {
break;
case CHANNEL_ID_HUMIDITY:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getHumidity(), SmartHomeUnits.PERCENT);
ruuvitagData.getHumidity(), Units.PERCENT);
break;
case CHANNEL_ID_MEASUREMENT_SEQUENCE_NUMBER:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getMeasurementSequenceNumber(), SmartHomeUnits.ONE);
ruuvitagData.getMeasurementSequenceNumber(), Units.ONE);
break;
case CHANNEL_ID_MOVEMENT_COUNTER:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getMovementCounter(), SmartHomeUnits.ONE);
ruuvitagData.getMovementCounter(), Units.ONE);
break;
case CHANNEL_ID_PRESSURE:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
@@ -151,7 +151,7 @@ public class RuuviTagHandler extends BeaconBluetoothHandler {
break;
case CHANNEL_ID_TX_POWER:
atLeastOneRuuviFieldPresent |= updateStateIfLinked(channelUID,
ruuvitagData.getTxPower(), SmartHomeUnits.DECIBEL_MILLIWATTS);
ruuvitagData.getTxPower(), Units.DECIBEL_MILLIWATTS);
break;
}
}