From ac6f08908fe3123d664cc41037880f4d33b8cf64 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Mon, 7 Dec 2020 10:34:02 +0100 Subject: [PATCH] Use renamed Units class (#9267) Signed-off-by: Wouter Born --- .../internal/AirQualityBindingConstants.java | 4 +- .../handler/AirVisualNodeHandler.java | 6 +- .../internal/handler/EchoHandler.java | 9 +- .../internal/processor/RemoteSensor.java | 6 +- .../internal/processor/Ws0900ipProcessor.java | 10 +- .../internal/processor/Ws1400ipProcessor.java | 12 +- .../internal/processor/Ws2902aProcessor.java | 12 +- .../internal/processor/Ws2902bProcessor.java | 12 +- .../internal/processor/Ws8482Processor.java | 4 +- .../astro/internal/model/MoonPhase.java | 10 +- .../astro/internal/model/Position.java | 6 +- .../astro/internal/model/Radiation.java | 8 +- .../binding/astro/internal/model/Range.java | 8 +- .../binding/astro/internal/model/Season.java | 6 +- .../internal/things/AutomowerHandler.java | 4 +- .../handler/AVMFritzBaseThingHandler.java | 10 +- .../handler/Powerline546EHandler.java | 10 +- .../internal/AirthingsBindingConstants.java | 8 +- .../internal/AirthingsWavePlusHandler.java | 11 +- .../blukii/handler/BlukiiHandler.java | 12 +- .../generic/internal/BluetoothUnit.java | 205 +++++++++--------- .../ruuvitag/internal/RuuviTagHandler.java | 18 +- .../bluetooth/BeaconBluetoothHandler.java | 4 +- .../internal/api/dto/Enums.java | 4 +- .../internal/api/dto/Measure.java | 5 +- .../internal/BuienradarHandler.java | 4 +- .../internal/ChromecastStatusUpdater.java | 6 +- .../internal/datatypes/DataTypeTime.java | 6 +- .../internal/datatypes/DataTypeVolt.java | 6 +- .../internal/dto/CoronaStatsCases.java | 4 +- .../internal/handler/DaikinAcUnitHandler.java | 18 +- .../DarkSkyWeatherAndForecastHandler.java | 2 +- .../handler/SensorThermostatThingHandler.java | 2 +- .../internal/handler/SensorThingHandler.java | 2 +- .../openhab/binding/deconz/SensorsTest.java | 4 +- .../internal/handler/ControllerHandler.java | 6 +- .../internal/handler/HotWaterHandler.java | 7 +- .../internal/handler/RoomHandler.java | 11 +- .../internal/handler/RoomStatHandler.java | 6 +- .../internal/handler/TRVHandler.java | 6 +- .../device/cosem/CosemObjectType.java | 4 +- .../internal/device/cosem/CosemQuantity.java | 18 +- .../handler/EcobeeSensorThingHandler.java | 4 +- .../EcobeeThermostatBridgeHandler.java | 20 +- .../internal/EnergeniePWMStateEnum.java | 10 +- .../internal/eep/A5_04/A5_04_02_Eltako.java | 4 +- .../enocean/internal/eep/A5_06/A5_06_01.java | 6 +- .../internal/eep/A5_06/A5_06_01_ELTAKO.java | 6 +- .../enocean/internal/eep/A5_07/A5_07.java | 4 +- .../enocean/internal/eep/A5_07/A5_07_03.java | 4 +- .../enocean/internal/eep/A5_08/A5_08.java | 4 +- .../enocean/internal/eep/A5_11/A5_11_03.java | 4 +- .../enocean/internal/eep/A5_11/A5_11_04.java | 7 +- .../enocean/internal/eep/A5_12/A5_12.java | 6 +- .../enocean/internal/eep/A5_12/A5_12_00.java | 6 +- .../enocean/internal/eep/A5_12/A5_12_01.java | 6 +- .../enocean/internal/eep/A5_12/A5_12_02.java | 4 +- .../enocean/internal/eep/A5_12/A5_12_03.java | 4 +- .../enocean/internal/eep/A5_13/A5_13_01.java | 8 +- .../enocean/internal/eep/A5_14/A5_14.java | 4 +- .../internal/eep/A5_14/A5_14_01_ELTAKO.java | 6 +- .../enocean/internal/eep/A5_20/A5_20_04.java | 8 +- .../internal/eep/A5_38/A5_38_08_Blinds.java | 4 +- .../enocean/internal/eep/D0/D0_06.java | 4 +- .../enocean/internal/eep/D2_01/D2_01.java | 6 +- .../enocean/internal/eep/D2_03/D2_03_0A.java | 4 +- .../enocean/internal/eep/D2_14/D2_14_30.java | 14 +- .../enocean/internal/eep/EEPHelper.java | 6 +- .../internal/ForecastWeatherHandler.java | 2 +- .../internal/ObservationWeatherHandler.java | 2 +- .../foobot/internal/json/FoobotSensor.java | 6 +- .../gce/internal/handler/Ipx800v3Handler.java | 6 +- .../internal/handler/GoEChargerHandler.java | 38 ++-- .../handler/GroheOndusSenseGuardHandler.java | 4 +- .../handler/GroheOndusSenseHandler.java | 4 +- .../internal/HeliosVentilationDataPoint.java | 6 +- .../handler/HeosThingBaseHandler.java | 4 +- .../converter/type/QuantityTypeConverter.java | 28 +-- .../converter/ConvertFromBindingTest.java | 8 +- .../hpprinter/internal/HPPrinterBinder.java | 30 +-- .../handler/sensors/LightLevelHandler.java | 4 +- .../internal/IammeterWEM3080Channel.java | 12 +- .../internal/IammeterWEM3080TChannel.java | 16 +- .../internal/device/MessageHandler.java | 13 +- .../internal/ec3k/Ec3kSensorHandler.java | 13 +- .../LaCrosseTemperatureSensorHandler.java | 7 +- .../internal/lacrosse/LgwSensorHandler.java | 5 +- .../internal/lacrosse/Tx22SensorHandler.java | 11 +- .../internal/pca301/Pca301SensorHandler.java | 6 +- .../internal/revolt/RevoltSensorHandler.java | 13 +- .../internal/handler/KaleidescapeHandler.java | 4 +- .../kodi/internal/handler/KodiHandler.java | 8 +- .../internal/handler/KonnectedHandler.java | 5 +- .../firstgeneration/WebscrapeHandler.java | 28 +-- .../ThirdGenerationHandler.java | 16 +- .../lcn/internal/converter/Converters.java | 14 +- .../lcn/internal/converter/S0Converter.java | 4 +- .../linky/internal/handler/LinkyHandler.java | 9 +- .../internal/handler/ConditionHandler.java | 7 +- .../internal/handler/NoiseHandler.java | 17 +- .../internal/handler/PMHandler.java | 10 +- .../internal/ConditionHandlerTest.java | 6 +- .../internal/NoiseHandlerTest.java | 20 +- .../luftdateninfo/internal/PMHandlerTest.java | 12 +- .../internal/handler/MagentaTVHandler.java | 6 +- .../internal/handler/MeteoBlueHandler.java | 4 +- .../handler/MeteostickSensorHandler.java | 2 +- .../handler/XiaomiDeviceBaseHandler.java | 8 +- .../miio/internal/MiIoQuantiyTypes.java | 18 +- .../internal/handler/MiIoBasicHandler.java | 9 +- .../internal/handler/MiIoVacuumHandler.java | 24 +- .../miio/internal/MiIoQuantityTypesTest.java | 14 +- .../handler/MillheatHeaterHandler.java | 6 +- .../modbus/e3dc/internal/dto/PowerBlock.java | 34 +-- .../modbus/e3dc/internal/dto/StringBlock.java | 20 +- .../internal/HeliosEasyControlsHandler.java | 30 +-- .../handler/StiebelEltronHandler.java | 2 +- .../internal/StuderBindingConstants.java | 2 +- .../internal/handler/InverterHandler.java | 2 +- .../internal/handler/MeterHandler.java | 2 +- .../mqtt/generic/values/NumberValue.java | 4 +- .../mqtt/generic/values/PercentageValue.java | 4 +- .../mystrom/internal/MyStromHandler.java | 2 +- .../neohub/internal/NeoHubHandler.java | 4 +- .../handler/NestThermostatHandler.java | 10 +- .../handler/AbstractNetatmoThingHandler.java | 10 +- .../internal/handler/NetworkHandler.java | 7 +- .../internal/handler/SpeedTestHandler.java | 8 +- .../internal/NUTBindingConstants.java | 2 +- .../networkupstools/internal/NutName.java | 24 +- .../model/DataResponseTransformer.java | 23 +- .../NikoHomeControlEnergyMeterHandler.java | 4 +- .../novafinedust/internal/SDS011Handler.java | 8 +- .../nuvo/internal/handler/NuvoHandler.java | 4 +- .../handler/OmnikInverterHandler.java | 8 +- .../binding/onewire/internal/Util.java | 4 +- .../onewire/internal/device/BAE0910.java | 19 +- .../onewire/internal/device/DS1923.java | 5 +- .../onewire/internal/device/DS2438.java | 21 +- .../onewire/internal/device/EDS006x.java | 7 +- .../handler/OpenSprinklerDeviceHandler.java | 6 +- .../handler/OpenSprinklerStationHandler.java | 8 +- .../internal/handler/OpenUVReportHandler.java | 6 +- .../openuv/internal/json/OpenUVResult.java | 4 +- .../handler/OpenWeatherMapOneCallHandler.java | 2 +- .../OpenWeatherMapOneCallHistoryHandler.java | 2 +- ...enWeatherMapWeatherAndForecastHandler.java | 2 +- .../oppo/internal/handler/OppoHandler.java | 4 +- .../handlers/ParadoxPanelHandler.java | 10 +- .../pixometer/handler/MeterHandler.java | 5 +- .../handler/PlugwiseRelayDeviceHandler.java | 8 +- .../handler/PlugwiseSenseHandler.java | 4 +- .../RadioThermostatBindingConstants.java | 6 +- .../internal/handler/HusdataHandler.java | 16 +- .../internal/rego6xx/RegoRegisterMapper.java | 6 +- .../RevogiSmartStripControlHandler.java | 4 +- .../internal/handler/RobonectHandler.java | 10 +- .../senechome/internal/SenecHomeHandler.java | 60 +++-- .../internal/handler/SenseBoxHandler.java | 12 +- .../internal/handler/SensiboSkyHandler.java | 4 +- .../internal/coap/ShellyCoIoTProtocol.java | 14 +- .../internal/coap/ShellyCoIoTVersion1.java | 18 +- .../internal/coap/ShellyCoIoTVersion2.java | 14 +- .../internal/handler/ShellyComponents.java | 46 ++-- .../internal/handler/ShellyLightHandler.java | 6 +- .../internal/handler/ShellyRelayHandler.java | 26 +-- .../binding/siemensrds/points/BasePoint.java | 8 +- .../binding/siemensrds/test/RdsTestData.java | 10 +- .../internal/conformity/Conformity.java | 4 +- .../internal/sml/SmlUnitConversion.java | 84 +++---- .../binding/smhi/internal/SmhiHandler.java | 14 +- .../AbstractDataResponseTransformer.java | 16 +- .../synopanalyser/internal/synop/Synop.java | 6 +- .../SynopAnalyzerBindingConstants.java | 4 +- .../tacmi/internal/schema/ApiPageParser.java | 16 +- ...leinfoAbstractElectricityMeterHandler.java | 33 ++- ...oAbstractCbemmElectricityMeterHandler.java | 10 +- ...actCbemmEvoIccElectricityMeterHandler.java | 4 +- ...oAbstractCbetmElectricityMeterHandler.java | 33 ++- .../internal/TellstickBindingConstants.java | 14 +- .../internal/TeslaChannelSelectorProxy.java | 6 +- .../internal/handler/TibberHandler.java | 10 +- .../internal/TouchWandAlarmSensorHandler.java | 4 +- .../internal/device/EnergySwitchDevice.java | 10 +- .../internal/handler/SmartHomeHandler.java | 4 +- .../internal/handler/UpnpRendererHandler.java | 14 +- .../handler/UpnpRendererHandlerTest.java | 4 +- .../valloxmv/internal/ValloxMVHandler.java | 5 +- .../valloxmv/internal/ValloxMVWebSocket.java | 30 ++- .../internal/handler/VelbusVMB4ANHandler.java | 10 +- .../handler/VelbusVMBMeteoHandler.java | 4 +- .../handler/VelbusVMBPIROHandler.java | 4 +- .../handler/VenstarThermostatHandler.java | 4 +- .../VerisureClimateDeviceThingHandler.java | 4 +- .../VerisureMiceDetectionThingHandler.java | 10 +- .../internal/handler/VigiCruesHandler.java | 6 +- .../internal/handler/VehicleHandler.java | 2 +- .../WeatherCompanyAbstractHandler.java | 4 +- .../WeatherCompanyForecastHandler.java | 10 +- .../WeatherCompanyObservationsHandler.java | 11 +- .../handler/WeatherUndergroundHandler.java | 16 +- .../internal/handler/WindcentraleHandler.java | 18 +- .../binding/wled/internal/WLedHandler.java | 6 +- .../internal/handler/ChannelHandler.java | 6 +- .../internal/handler/ZmMonitorHandler.java | 4 +- .../mapdb/StateTypeAdapterTest.java | 7 +- .../cases/AstroParametrizedTestCases.java | 30 +-- .../handler/NestThermostatHandlerTest.java | 16 +- 208 files changed, 1087 insertions(+), 1169 deletions(-) diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java index b5aeea645a8..23baca8ef35 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java @@ -27,7 +27,7 @@ import javax.measure.quantity.Temperature; import org.eclipse.jdt.annotation.NonNullByDefault; 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.ThingTypeUID; import org.openhab.core.types.State; @@ -80,6 +80,6 @@ public class AirQualityBindingConstants { // Units of measurement of the data delivered by the API public static final Unit API_TEMPERATURE_UNIT = SIUnits.CELSIUS; - public static final Unit API_HUMIDITY_UNIT = SmartHomeUnits.PERCENT; + public static final Unit API_HUMIDITY_UNIT = Units.PERCENT; public static final Unit API_PRESSURE_UNIT = HECTO(SIUnits.PASCAL); } diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java index 8a9cc0a302b..9d870c9027f 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java @@ -17,9 +17,9 @@ import static org.openhab.core.library.unit.MetricPrefix.MICRO; import static org.openhab.core.library.unit.SIUnits.CELSIUS; import static org.openhab.core.library.unit.SIUnits.CUBIC_METRE; import static org.openhab.core.library.unit.SIUnits.GRAM; -import static org.openhab.core.library.unit.SmartHomeUnits.ONE; -import static org.openhab.core.library.unit.SmartHomeUnits.PARTS_PER_MILLION; -import static org.openhab.core.library.unit.SmartHomeUnits.PERCENT; +import static org.openhab.core.library.unit.Units.ONE; +import static org.openhab.core.library.unit.Units.PARTS_PER_MILLION; +import static org.openhab.core.library.unit.Units.PERCENT; import java.io.IOException; import java.math.BigDecimal; diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java index 89deefaaf51..75b344de393 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java @@ -68,7 +68,7 @@ import org.openhab.core.library.types.PlayPauseType; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.RewindFastforwardType; import org.openhab.core.library.types.StringType; -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.ChannelUID; import org.openhab.core.thing.Thing; @@ -330,7 +330,7 @@ public class EchoHandler extends BaseThingHandler implements IEchoThingHandler { if (command instanceof QuantityType) { QuantityType value = (QuantityType) command; @Nullable - QuantityType seconds = value.toUnit(SmartHomeUnits.SECOND); + QuantityType seconds = value.toUnit(Units.SECOND); if (seconds != null) { mediaPosition = seconds.longValue(); } @@ -1183,10 +1183,9 @@ public class EchoHandler extends BaseThingHandler implements IEchoThingHandler { } else { updateState(CHANNEL_MEDIA_PROGRESS, UnDefType.UNDEF); } - updateState(CHANNEL_MEDIA_PROGRESS_TIME, - new QuantityType<>(currentPlayTimeMs / 1000, SmartHomeUnits.SECOND)); + updateState(CHANNEL_MEDIA_PROGRESS_TIME, new QuantityType<>(currentPlayTimeMs / 1000, Units.SECOND)); if (updateMediaLength) { - updateState(CHANNEL_MEDIA_LENGTH, new QuantityType<>(mediaLengthMs / 1000, SmartHomeUnits.SECOND)); + updateState(CHANNEL_MEDIA_LENGTH, new QuantityType<>(mediaLengthMs / 1000, Units.SECOND)); } } else { updateState(CHANNEL_MEDIA_PROGRESS, UnDefType.UNDEF); diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java index 865e6e51767..21ff405b5f3 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java @@ -22,7 +22,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,14 +94,14 @@ public class RemoteSensor { reader.nextDouble(), ImperialUnits.FAHRENHEIT); } else if (("humidity" + sensorNumber).equals(name)) { handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_HUMIDITY, reader.nextDouble(), - SmartHomeUnits.PERCENT); + Units.PERCENT); } else if (("soiltemp" + sensorNumber).equals(name)) { handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_SOIL_TEMPERATURE, reader.nextDouble(), ImperialUnits.FAHRENHEIT); } else if (("soilhum" + sensorNumber).equals(name)) { Double soilMoisture = reader.nextDouble(); handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_SOIL_MOISTURE, soilMoisture, - SmartHomeUnits.PERCENT); + Units.PERCENT); handler.updateString(CHGRP_REMOTE_SENSOR + sensorNumber, CH_SOIL_MOISTURE_LEVEL, convertSoilMoistureToString(soilMoisture)); } else if (("batt" + sensorNumber).equals(name)) { diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java index e92c9b4a57c..6a7eea78b2e 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.binding.ambientweather.internal.model.EventDataJson; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * The {@link Ws0900ipProcessor} is responsible for updating @@ -60,14 +60,14 @@ public class Ws0900ipProcessor extends AbstractProcessor { handler.updateString(channelGroupId, CH_BATTERY_INDICATOR, NOT_APPLICABLE); handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempf, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_DEW_POINT, data.dewPoint, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, SmartHomeUnits.PERCENT); + handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, Units.PERCENT); handler.updateQuantity(channelGroupId, CH_PRESSURE_ABSOLUTE, data.baromabsin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_PRESSURE_RELATIVE, data.baromrelin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_WIND_SPEED, data.windspeedmph, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, SmartHomeUnits.DEGREE_ANGLE); + handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, Units.DEGREE_ANGLE); handler.updateQuantity(channelGroupId, CH_WIND_GUST, data.windgustmph, ImperialUnits.MILES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_WIND_GUST_MAX_DAILY, data.maxdailygust, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, SmartHomeUnits.INCHES_PER_HOUR); + handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, Units.INCHES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_RAIN_DAY, data.dailyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_WEEK, data.weeklyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_MONTH, data.monthlyrainin, ImperialUnits.INCH); @@ -86,7 +86,7 @@ public class Ws0900ipProcessor extends AbstractProcessor { // Update indoor sensor channels handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, SmartHomeUnits.PERCENT); + handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, Units.PERCENT); handler.updateString(CHGRP_INDOOR_SENSOR, CH_BATTERY_INDICATOR, NOT_APPLICABLE); } } diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java index 69cf3196fb6..ca4a167d689 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.binding.ambientweather.internal.model.EventDataJson; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * The {@link Ws1400ipProcessor} is responsible for updating @@ -61,16 +61,16 @@ public class Ws1400ipProcessor extends AbstractProcessor { handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempf, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_FEELING_TEMPERATURE, data.feelsLike, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_DEW_POINT, data.dewPoint, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, SmartHomeUnits.PERCENT); + handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, Units.PERCENT); handler.updateQuantity(channelGroupId, CH_PRESSURE_ABSOLUTE, data.baromabsin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_PRESSURE_RELATIVE, data.baromrelin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_WIND_SPEED, data.windspeedmph, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, SmartHomeUnits.DEGREE_ANGLE); + handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, Units.DEGREE_ANGLE); handler.updateQuantity(channelGroupId, CH_WIND_GUST, data.windgustmph, ImperialUnits.MILES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_WIND_GUST_MAX_DAILY, data.maxdailygust, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, SmartHomeUnits.IRRADIANCE); + handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, Units.IRRADIANCE); handler.updateNumber(channelGroupId, CH_UV_INDEX, data.uv); - handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, SmartHomeUnits.INCHES_PER_HOUR); + handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, Units.INCHES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_RAIN_DAY, data.dailyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_WEEK, data.weeklyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_MONTH, data.monthlyrainin, ImperialUnits.INCH); @@ -93,7 +93,7 @@ public class Ws1400ipProcessor extends AbstractProcessor { // Update indoor sensor channels handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, SmartHomeUnits.PERCENT); + handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, Units.PERCENT); handler.updateString(CHGRP_INDOOR_SENSOR, CH_BATTERY_INDICATOR, data.battin); // Update channels for the remote sensors diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java index 3ecabf509b6..c1f8939939b 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.binding.ambientweather.internal.model.EventDataJson; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * The {@link Ws2902aProcessor} is responsible for updating @@ -61,16 +61,16 @@ public class Ws2902aProcessor extends AbstractProcessor { handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempf, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_FEELING_TEMPERATURE, data.feelsLike, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_DEW_POINT, data.dewPoint, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, SmartHomeUnits.PERCENT); + handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, Units.PERCENT); handler.updateQuantity(channelGroupId, CH_PRESSURE_ABSOLUTE, data.baromabsin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_PRESSURE_RELATIVE, data.baromrelin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_WIND_SPEED, data.windspeedmph, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, SmartHomeUnits.DEGREE_ANGLE); + handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, Units.DEGREE_ANGLE); handler.updateQuantity(channelGroupId, CH_WIND_GUST, data.windgustmph, ImperialUnits.MILES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_WIND_GUST_MAX_DAILY, data.maxdailygust, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, SmartHomeUnits.IRRADIANCE); + handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, Units.IRRADIANCE); handler.updateNumber(channelGroupId, CH_UV_INDEX, data.uv); - handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, SmartHomeUnits.INCHES_PER_HOUR); + handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, Units.INCHES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_RAIN_DAY, data.dailyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_WEEK, data.weeklyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_MONTH, data.monthlyrainin, ImperialUnits.INCH); @@ -93,7 +93,7 @@ public class Ws2902aProcessor extends AbstractProcessor { // Update indoor sensor channels handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, SmartHomeUnits.PERCENT); + handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, Units.PERCENT); handler.updateString(CHGRP_INDOOR_SENSOR, CH_BATTERY_INDICATOR, NOT_APPLICABLE); } } diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902bProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902bProcessor.java index 26c8c8b0ccc..44b6ea44255 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902bProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902bProcessor.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.binding.ambientweather.internal.model.EventDataJson; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * The {@link Ws2902bProcessor} is responsible for updating @@ -61,16 +61,16 @@ public class Ws2902bProcessor extends AbstractProcessor { handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempf, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_FEELING_TEMPERATURE, data.feelsLike, ImperialUnits.FAHRENHEIT); handler.updateQuantity(channelGroupId, CH_DEW_POINT, data.dewPoint, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, SmartHomeUnits.PERCENT); + handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidity, Units.PERCENT); handler.updateQuantity(channelGroupId, CH_PRESSURE_ABSOLUTE, data.baromabsin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_PRESSURE_RELATIVE, data.baromrelin, ImperialUnits.INCH_OF_MERCURY); handler.updateQuantity(channelGroupId, CH_WIND_SPEED, data.windspeedmph, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, SmartHomeUnits.DEGREE_ANGLE); + handler.updateQuantity(channelGroupId, CH_WIND_DIRECTION_DEGREES, data.winddir, Units.DEGREE_ANGLE); handler.updateQuantity(channelGroupId, CH_WIND_GUST, data.windgustmph, ImperialUnits.MILES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_WIND_GUST_MAX_DAILY, data.maxdailygust, ImperialUnits.MILES_PER_HOUR); - handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, SmartHomeUnits.IRRADIANCE); + handler.updateQuantity(channelGroupId, CH_SOLAR_RADIATION, data.solarradiation, Units.IRRADIANCE); handler.updateNumber(channelGroupId, CH_UV_INDEX, data.uv); - handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, SmartHomeUnits.INCHES_PER_HOUR); + handler.updateQuantity(channelGroupId, CH_RAIN_HOURLY_RATE, data.hourlyrainin, Units.INCHES_PER_HOUR); handler.updateQuantity(channelGroupId, CH_RAIN_DAY, data.dailyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_WEEK, data.weeklyrainin, ImperialUnits.INCH); handler.updateQuantity(channelGroupId, CH_RAIN_MONTH, data.monthlyrainin, ImperialUnits.INCH); @@ -93,7 +93,7 @@ public class Ws2902bProcessor extends AbstractProcessor { // Update indoor sensor channels handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, SmartHomeUnits.PERCENT); + handler.updateQuantity(CHGRP_INDOOR_SENSOR, CH_HUMIDITY, data.humidityin, Units.PERCENT); handler.updateString(CHGRP_INDOOR_SENSOR, CH_BATTERY_INDICATOR, NOT_APPLICABLE); // Update channels for the remote sensors diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java index b192d04ecf3..5ddeeed756d 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; import org.openhab.binding.ambientweather.internal.model.EventDataJson; import org.openhab.core.library.unit.ImperialUnits; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * The {@link Ws8482Processor} is responsible for updating @@ -59,7 +59,7 @@ public class Ws8482Processor extends AbstractProcessor { handler.updateDate(channelGroupId, CH_OBSERVATION_TIME, data.date); handler.updateString(channelGroupId, CH_BATTERY_INDICATOR, data.battout); handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); - handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidityin, SmartHomeUnits.PERCENT); + handler.updateQuantity(channelGroupId, CH_HUMIDITY, data.humidityin, Units.PERCENT); // Update the remote sensor channels remoteSensor.updateChannels(handler, jsonData); diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java index 0d424f473a0..c6d6171e963 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java @@ -19,7 +19,7 @@ import javax.measure.quantity.Dimensionless; import javax.measure.quantity.Time; import org.openhab.core.library.types.QuantityType; -import org.openhab.core.library.unit.SmartHomeUnits; +import org.openhab.core.library.unit.Units; /** * Holds the calculates moon phase informations. @@ -99,7 +99,7 @@ public class MoonPhase { * Returns the age in days. */ public QuantityType