diff --git a/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMRuleTemplate.java b/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMRuleTemplate.java index 84268492164..bb6f7380451 100644 --- a/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMRuleTemplate.java +++ b/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMRuleTemplate.java @@ -46,10 +46,10 @@ public class PWMRuleTemplate extends RuleTemplate { final List triggers = List.of(ModuleBuilder.createTrigger().withId(triggerId) .withTypeUID(PWMTriggerType.UID).withLabel("PWM Trigger").build()); - final Map actionInputs = new HashMap(); + final Map actionInputs = new HashMap<>(); actionInputs.put(PWMConstants.INPUT, triggerId + "." + PWMConstants.OUTPUT); - Set tags = new HashSet(); + Set tags = new HashSet<>(); tags.add("PWM"); return new PWMRuleTemplate(tags, triggers, Collections.emptyList(), Collections.emptyList(), diff --git a/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMTemplateProvider.java b/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMTemplateProvider.java index cdd49202121..d357c31f8f7 100644 --- a/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMTemplateProvider.java +++ b/bundles/org.openhab.automation.pwm/src/main/java/org/openhab/automation/pwm/internal/template/PWMTemplateProvider.java @@ -33,7 +33,7 @@ import org.osgi.service.component.annotations.Component; @Component @NonNullByDefault public class PWMTemplateProvider implements RuleTemplateProvider { - private final Map providedRuleTemplates = new HashMap(); + private final Map providedRuleTemplates = new HashMap<>(); public PWMTemplateProvider() { providedRuleTemplates.put(PWMRuleTemplate.UID, PWMRuleTemplate.initialize()); diff --git a/bundles/org.openhab.binding.alarmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/ADMessage.java b/bundles/org.openhab.binding.alarmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/ADMessage.java index b540eb003a4..3ef4727f2ce 100644 --- a/bundles/org.openhab.binding.alarmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/ADMessage.java +++ b/bundles/org.openhab.binding.alarmdecoder/src/main/java/org/openhab/binding/alarmdecoder/internal/protocol/ADMessage.java @@ -44,7 +44,7 @@ public abstract class ADMessage { /** Utility routine to split an AD message into its component parts */ protected static List splitMsg(String msg) { - List l = new ArrayList(); + List l = new ArrayList<>(); Matcher regexMatcher = SPLIT_REGEX.matcher(msg); while (regexMatcher.find()) { l.add(regexMatcher.group()); diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java index 053666463bd..6bd7a7783c3 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java @@ -40,7 +40,7 @@ public class PcapNetworkInterfaceWrapper { /** * Use this Guava function in order to create a {@link PcapNetworkInterfaceWrapper} instance. */ - public static final Function TRANSFORMER = new Function() { + public static final Function TRANSFORMER = new Function<>() { @Override public PcapNetworkInterfaceWrapper apply(PcapNetworkInterface pcapNetworkInterface) { diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/SmartHomeDevicesDiscovery.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/SmartHomeDevicesDiscovery.java index 6718a47e43c..d1f677ef921 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/SmartHomeDevicesDiscovery.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/SmartHomeDevicesDiscovery.java @@ -60,7 +60,7 @@ public class SmartHomeDevicesDiscovery extends AbstractDiscoveryService { } public void activate() { - activate(new Hashtable()); + activate(new Hashtable<>()); } @Override diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerTemperatureSensor.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerTemperatureSensor.java index 6a8064b2860..88ff4c3ed38 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerTemperatureSensor.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerTemperatureSensor.java @@ -83,9 +83,9 @@ public class HandlerTemperatureSensor extends HandlerBase { float temperature = value.get("value").getAsFloat(); String scale = value.get("scale").getAsString(); if ("CELSIUS".equals(scale)) { - temperatureValue = new QuantityType(temperature, SIUnits.CELSIUS); + temperatureValue = new QuantityType<>(temperature, SIUnits.CELSIUS); } else { - temperatureValue = new QuantityType(temperature, ImperialUnits.FAHRENHEIT); + temperatureValue = new QuantityType<>(temperature, ImperialUnits.FAHRENHEIT); } } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerThermostatController.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerThermostatController.java index ca65d50fec2..476b7fdd267 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerThermostatController.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/HandlerThermostatController.java @@ -101,9 +101,9 @@ public class HandlerThermostatController extends HandlerBase { float temperature = value.get("value").getAsFloat(); String scale = value.get("scale").getAsString().toUpperCase(); if ("CELSIUS".equals(scale)) { - temperatureValue = new QuantityType(temperature, SIUnits.CELSIUS); + temperatureValue = new QuantityType<>(temperature, SIUnits.CELSIUS); } else { - temperatureValue = new QuantityType(temperature, ImperialUnits.FAHRENHEIT); + temperatureValue = new QuantityType<>(temperature, ImperialUnits.FAHRENHEIT); } } updateState(TARGET_SETPOINT.channelId, temperatureValue == null ? UnDefType.UNDEF : temperatureValue); @@ -121,9 +121,9 @@ public class HandlerThermostatController extends HandlerBase { float temperature = value.get("value").getAsFloat(); String scale = value.get("scale").getAsString().toUpperCase(); if ("CELSIUS".equals(scale)) { - temperatureValue = new QuantityType(temperature, SIUnits.CELSIUS); + temperatureValue = new QuantityType<>(temperature, SIUnits.CELSIUS); } else { - temperatureValue = new QuantityType(temperature, ImperialUnits.FAHRENHEIT); + temperatureValue = new QuantityType<>(temperature, ImperialUnits.FAHRENHEIT); } } updateState(UPPER_SETPOINT.channelId, temperatureValue == null ? UnDefType.UNDEF : temperatureValue); @@ -135,9 +135,9 @@ public class HandlerThermostatController extends HandlerBase { float temperature = value.get("value").getAsFloat(); String scale = value.get("scale").getAsString().toUpperCase(); if ("CELSIUS".equals(scale)) { - temperatureValue = new QuantityType(temperature, SIUnits.CELSIUS); + temperatureValue = new QuantityType<>(temperature, SIUnits.CELSIUS); } else { - temperatureValue = new QuantityType(temperature, ImperialUnits.FAHRENHEIT); + temperatureValue = new QuantityType<>(temperature, ImperialUnits.FAHRENHEIT); } } updateState(LOWER_SETPOINT.channelId, temperatureValue == null ? UnDefType.UNDEF : temperatureValue); diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/SmartHomeDeviceStateGroupUpdateCalculator.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/SmartHomeDeviceStateGroupUpdateCalculator.java index 6a3632ca92a..5674a7c1ad0 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/SmartHomeDeviceStateGroupUpdateCalculator.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/smarthome/SmartHomeDeviceStateGroupUpdateCalculator.java @@ -106,7 +106,7 @@ public class SmartHomeDeviceStateGroupUpdateCalculator { } } // check which groups needs an update - Set groupsToUpdate = new HashSet(); + Set groupsToUpdate = new HashSet<>(); for (UpdateGroup group : updateGroups.values()) { long millisecondsSinceLastUpdate = updateTimeStamp.getTime() - group.lastUpdated.getTime(); if (syncAllGroups || millisecondsSinceLastUpdate >= group.intervalInSeconds * 1000) { diff --git a/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/Group.java b/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/Group.java index 4be24caf977..605d42a578b 100644 --- a/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/Group.java +++ b/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/Group.java @@ -49,7 +49,7 @@ public class Group { /** * Set of zones belonging to a group **/ - private Set zones = new LinkedHashSet(); + private Set zones = new LinkedHashSet<>(); @Schema /** diff --git a/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/ValidationError.java b/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/ValidationError.java index 1d297f0a528..a3cd9f2a447 100644 --- a/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/ValidationError.java +++ b/bundles/org.openhab.binding.amplipi/src/gen/java/org/openhab/binding/amplipi/internal/model/ValidationError.java @@ -20,7 +20,7 @@ import io.swagger.v3.oas.annotations.media.Schema; public class ValidationError { @Schema(required = true) - private List loc = new ArrayList(); + private List loc = new ArrayList<>(); @Schema(required = true) private String msg; diff --git a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/AndroidTVHandler.java b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/AndroidTVHandler.java index f060214bfe4..a1d0fe7247b 100644 --- a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/AndroidTVHandler.java +++ b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/AndroidTVHandler.java @@ -99,7 +99,7 @@ public class AndroidTVHandler extends BaseThingHandler { public void updateCDP(String channelName, Map cdpMap) { logger.trace("{} - Updating CDP for {}", this.thingID, channelName); - List commandOptions = new ArrayList(); + List commandOptions = new ArrayList<>(); cdpMap.forEach((key, value) -> commandOptions.add(new CommandOption(key, value))); logger.trace("{} - CDP List: {}", this.thingID, commandOptions); commandDescriptionProvider.setCommandOptions(new ChannelUID(getThing().getUID(), channelName), commandOptions); diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java index de3f16e61b9..f00fc4fb1d6 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java @@ -346,7 +346,7 @@ public class SunCalc { public static Map sortByValue(Map map) { List> list = new ArrayList<>(map.entrySet()); - Collections.sort(list, new Comparator>() { + Collections.sort(list, new Comparator<>() { @Override public int compare(Entry p1, Entry p2) { Range p1Range = p1.getValue(); diff --git a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/AutomowerBindingConstants.java b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/AutomowerBindingConstants.java index e3077131303..aa140b49e42 100644 --- a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/AutomowerBindingConstants.java +++ b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/AutomowerBindingConstants.java @@ -54,7 +54,7 @@ public class AutomowerBindingConstants { // introduce // this in a future release public static final String LAST_POSITION = GROUP_POSITIONS + "last-position"; - public static final ArrayList CHANNEL_POSITIONS = new ArrayList( + public static final ArrayList CHANNEL_POSITIONS = new ArrayList<>( List.of(GROUP_POSITIONS + "position01", GROUP_POSITIONS + "position02", GROUP_POSITIONS + "position03", GROUP_POSITIONS + "position04", GROUP_POSITIONS + "position05", GROUP_POSITIONS + "position06", GROUP_POSITIONS + "position07", GROUP_POSITIONS + "position08", GROUP_POSITIONS + "position09", diff --git a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/rest/api/automowerconnect/dto/MowerData.java b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/rest/api/automowerconnect/dto/MowerData.java index f088f8c9fab..3f861c33fee 100644 --- a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/rest/api/automowerconnect/dto/MowerData.java +++ b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/rest/api/automowerconnect/dto/MowerData.java @@ -24,7 +24,7 @@ public class MowerData { private Calendar calendar; private Planner planner; private Metadata metadata; - private ArrayList positions = new ArrayList(); + private ArrayList positions = new ArrayList<>(); public System getSystem() { return system; diff --git a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java index 52797be3f00..b0a87a253cd 100644 --- a/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java +++ b/bundles/org.openhab.binding.automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java @@ -25,8 +25,6 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import javax.measure.quantity.Dimensionless; - import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.automower.internal.AutomowerBindingConstants; @@ -80,7 +78,7 @@ public class AutomowerHandler extends BaseThingHandler { private final Logger logger = LoggerFactory.getLogger(AutomowerHandler.class); private final TimeZoneProvider timeZoneProvider; - private AtomicReference automowerId = new AtomicReference(NO_ID); + private AtomicReference automowerId = new AtomicReference<>(NO_ID); private long lastQueryTimeMs = 0L; private @Nullable ScheduledFuture automowerPollingJob; @@ -290,8 +288,8 @@ public class AutomowerHandler extends BaseThingHandler { updateState(CHANNEL_STATUS_LAST_UPDATE, new DateTimeType(toZonedDateTime(mower.getAttributes().getMetadata().getStatusTimestamp()))); - updateState(CHANNEL_STATUS_BATTERY, new QuantityType( - mower.getAttributes().getBattery().getBatteryPercent(), Units.PERCENT)); + updateState(CHANNEL_STATUS_BATTERY, + new QuantityType<>(mower.getAttributes().getBattery().getBatteryPercent(), Units.PERCENT)); updateState(CHANNEL_STATUS_ERROR_CODE, new DecimalType(mower.getAttributes().getMower().getErrorCode())); diff --git a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarNonConsecutiveBestPriceResult.java b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarNonConsecutiveBestPriceResult.java index 7de1b7d0ca4..9b9b768a7b6 100644 --- a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarNonConsecutiveBestPriceResult.java +++ b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarNonConsecutiveBestPriceResult.java @@ -37,7 +37,7 @@ public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult public AwattarNonConsecutiveBestPriceResult(int size, ZoneId zoneId) { super(); this.zoneId = zoneId; - members = new ArrayList(); + members = new ArrayList<>(); } public void addMember(AwattarPrice member) { @@ -59,7 +59,7 @@ public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult private void sort() { if (!sorted) { - members.sort(new Comparator() { + members.sort(new Comparator<>() { @Override public int compare(AwattarPrice o1, AwattarPrice o2) { return Long.compare(o1.getStartTimestamp(), o2.getStartTimestamp()); diff --git a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestpriceHandler.java b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestpriceHandler.java index 41b7b8a02e4..091d0c4c7c3 100644 --- a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestpriceHandler.java +++ b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestpriceHandler.java @@ -153,7 +153,7 @@ public class AwattarBestpriceHandler extends BaseThingHandler { AwattarBestPriceResult result; if (config.consecutive) { - ArrayList range = new ArrayList(config.rangeDuration); + ArrayList range = new ArrayList<>(config.rangeDuration); range.addAll(getPriceRange(bridgeHandler, timerange, (o1, o2) -> Long.compare(o1.getStartTimestamp(), o2.getStartTimestamp()))); AwattarConsecutiveBestPriceResult res = new AwattarConsecutiveBestPriceResult( diff --git a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveMiniHandler.java b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveMiniHandler.java index f9452433581..7731720731d 100644 --- a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveMiniHandler.java +++ b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveMiniHandler.java @@ -17,9 +17,6 @@ import static org.openhab.binding.bluetooth.airthings.internal.AirthingsBindingC import java.util.Map; import java.util.UUID; -import javax.measure.quantity.Dimensionless; -import javax.measure.quantity.Temperature; - import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.unit.SIUnits; @@ -55,15 +52,15 @@ public class AirthingsWaveMiniHandler extends AbstractAirthingsHandler { logger.debug("Parsed data: {}", data); Number humidity = data.get(AirthingsDataParser.HUMIDITY); if (humidity != null) { - updateState(CHANNEL_ID_HUMIDITY, new QuantityType(humidity, Units.PERCENT)); + updateState(CHANNEL_ID_HUMIDITY, new QuantityType<>(humidity, Units.PERCENT)); } Number temperature = data.get(AirthingsDataParser.TEMPERATURE); if (temperature != null) { - updateState(CHANNEL_ID_TEMPERATURE, new QuantityType(temperature, SIUnits.CELSIUS)); + updateState(CHANNEL_ID_TEMPERATURE, new QuantityType<>(temperature, SIUnits.CELSIUS)); } Number tvoc = data.get(AirthingsDataParser.TVOC); if (tvoc != null) { - updateState(CHANNEL_ID_TVOC, new QuantityType(tvoc, Units.PARTS_PER_BILLION)); + updateState(CHANNEL_ID_TVOC, new QuantityType<>(tvoc, Units.PARTS_PER_BILLION)); } } catch (AirthingsParserException e) { logger.error("Failed to parse data received from Airthings sensor: {}", e.getMessage()); diff --git a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWavePlusHandler.java b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWavePlusHandler.java index 0d02b34c9da..fba99fdc307 100644 --- a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWavePlusHandler.java +++ b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWavePlusHandler.java @@ -17,12 +17,7 @@ import static org.openhab.binding.bluetooth.airthings.internal.AirthingsBindingC import java.util.Map; import java.util.UUID; -import javax.measure.quantity.Dimensionless; -import javax.measure.quantity.Pressure; -import javax.measure.quantity.Temperature; - import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.core.library.dimension.RadiationSpecificActivity; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.unit.SIUnits; import org.openhab.core.library.unit.Units; @@ -57,33 +52,33 @@ public class AirthingsWavePlusHandler extends AbstractAirthingsHandler { logger.debug("Parsed data: {}", data); Number humidity = data.get(AirthingsDataParser.HUMIDITY); if (humidity != null) { - updateState(CHANNEL_ID_HUMIDITY, new QuantityType(humidity, Units.PERCENT)); + updateState(CHANNEL_ID_HUMIDITY, new QuantityType<>(humidity, Units.PERCENT)); } Number temperature = data.get(AirthingsDataParser.TEMPERATURE); if (temperature != null) { - updateState(CHANNEL_ID_TEMPERATURE, new QuantityType(temperature, SIUnits.CELSIUS)); + updateState(CHANNEL_ID_TEMPERATURE, new QuantityType<>(temperature, SIUnits.CELSIUS)); } Number pressure = data.get(AirthingsDataParser.PRESSURE); if (pressure != null) { - updateState(CHANNEL_ID_PRESSURE, new QuantityType(pressure, Units.MILLIBAR)); + updateState(CHANNEL_ID_PRESSURE, new QuantityType<>(pressure, Units.MILLIBAR)); } Number co2 = data.get(AirthingsDataParser.CO2); if (co2 != null) { - updateState(CHANNEL_ID_CO2, new QuantityType(co2, Units.PARTS_PER_MILLION)); + updateState(CHANNEL_ID_CO2, new QuantityType<>(co2, Units.PARTS_PER_MILLION)); } Number tvoc = data.get(AirthingsDataParser.TVOC); if (tvoc != null) { - updateState(CHANNEL_ID_TVOC, new QuantityType(tvoc, Units.PARTS_PER_BILLION)); + updateState(CHANNEL_ID_TVOC, new QuantityType<>(tvoc, Units.PARTS_PER_BILLION)); } Number radonShortTermAvg = data.get(AirthingsDataParser.RADON_SHORT_TERM_AVG); if (radonShortTermAvg != null) { - updateState(CHANNEL_ID_RADON_ST_AVG, new QuantityType(radonShortTermAvg, - Units.BECQUEREL_PER_CUBIC_METRE)); + updateState(CHANNEL_ID_RADON_ST_AVG, + new QuantityType<>(radonShortTermAvg, Units.BECQUEREL_PER_CUBIC_METRE)); } Number radonLongTermAvg = data.get(AirthingsDataParser.RADON_LONG_TERM_AVG); if (radonLongTermAvg != null) { updateState(CHANNEL_ID_RADON_LT_AVG, - new QuantityType(radonLongTermAvg, Units.BECQUEREL_PER_CUBIC_METRE)); + new QuantityType<>(radonLongTermAvg, Units.BECQUEREL_PER_CUBIC_METRE)); } } catch (AirthingsParserException e) { logger.error("Failed to parse data received from Airthings sensor: {}", e.getMessage()); diff --git a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetIndoorOutoorTemperatures.java b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetIndoorOutoorTemperatures.java index 33f14f44620..13dd834ad59 100644 --- a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetIndoorOutoorTemperatures.java +++ b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetIndoorOutoorTemperatures.java @@ -74,10 +74,10 @@ public class GetIndoorOutoorTemperatures extends BRC1HCommand { } } - indoorTemperature = new QuantityType(iIndoorTemperature, SIUnits.CELSIUS); + indoorTemperature = new QuantityType<>(iIndoorTemperature, SIUnits.CELSIUS); if (iOutdoorTemperature != null) { - outdoorTemperature = new QuantityType(iOutdoorTemperature, SIUnits.CELSIUS); + outdoorTemperature = new QuantityType<>(iOutdoorTemperature, SIUnits.CELSIUS); } logger.debug("Indoor Temp: {}", indoorTemperature); diff --git a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetOperationHoursCommand.java b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetOperationHoursCommand.java index 51e59c77112..def5161ac79 100644 --- a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetOperationHoursCommand.java +++ b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/commands/GetOperationHoursCommand.java @@ -79,9 +79,9 @@ public class GetOperationHoursCommand extends BRC1HCommand { Integer iIndoorFanHours = (int) (fanHours.getComputedValue(ByteOrder.LITTLE_ENDIAN)); Integer iIndoorPowerHours = (int) (powerHours.getComputedValue(ByteOrder.LITTLE_ENDIAN)); - this.indoorOperationHours = new QuantityType