From 54fd13b0c1fb8419e69ac4e7d08cb42feea5326d Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 13 Sep 2024 17:20:11 +0200 Subject: [PATCH] Reduce SAT warnings (#17406) * Reduce SAT warnings Signed-off-by: Holger Friedrich --- .../main/resources/OH-INF/config/config.xml | 2 +- .../handler/DynamicChannelHelper.java | 6 ++-- .../astro/internal/handler/SunHandler.java | 7 +++- .../handler/AwattarBridgeHandler.java | 1 - .../AwattarBridgeHandlerRefreshTest.java | 1 - .../handler/AwattarBridgeHandlerTest.java | 1 - .../internal/AirthingsWaveGen1Handler.java | 2 +- .../internal/model/MadokaValue.java | 1 - .../internal/BluetoothChannelUtils.java | 14 ++++---- .../CharacteristicChannelTypeProvider.java | 2 +- .../binding/cm11a/internal/X10Interface.java | 2 +- .../discovery/SceneDiscoveryService.java | 1 - .../internal/handler/CircuitHandler.java | 4 +-- .../constants/JSONApiResponseKeysEnum.java | 4 +-- .../internal/handler/ControllerHandler.java | 4 +-- .../internal/handler/HotWaterHandler.java | 4 +-- .../model/GenericResponseTransformer.java | 1 - .../internal/EmotivaProcessorHandler.java | 1 - .../main/resources/OH-INF/thing/channels.xml | 4 +-- .../handler/EnvoyEntrezConnector.java | 1 - .../resources/OH-INF/config/bridge-config.xml | 2 +- .../internal/radio/FrontierSiliconRadio.java | 4 +-- .../radio/FrontierSiliconRadioApiResult.java | 4 +-- .../radio/FrontierSiliconRadioConnection.java | 5 ++- .../radio/FrontierSiliconRadioConstants.java | 2 +- .../internal/things/GroupePSAHandler.java | 2 -- .../growatt/internal/cloud/GrowattCloud.java | 1 - .../common/AuthenticationHandler.java | 2 +- .../HomematicDeviceDiscoveryService.java | 1 - .../internal/HomeWizardDeviceHandler.java | 2 +- .../HomeWizardStatefulDeviceHandler.java | 2 +- .../internal/handler/Clip2BridgeHandler.java | 3 +- .../internal/handler/ICloudDeviceHandler.java | 1 - .../profiles/PushButtonToCommandProfile.java | 1 - .../binding/insteon/internal/driver/Port.java | 1 - .../main/resources/OH-INF/thing/Channels.xml | 2 +- .../miio/internal/cloud/CloudConnector.java | 2 +- .../handler/ModbusDataThingHandler.java | 1 - .../profiles/ModbusGainOffsetProfile.java | 1 - .../resources/OH-INF/thing/thing-data.xml | 6 ++-- .../main/resources/OH-INF/config/config.xml | 2 +- .../binding/mqtt/generic/ChannelState.java | 1 - .../main/resources/OH-INF/config/config.xml | 10 +++--- .../internal/parser/GatewayPayloadParser.java | 1 - .../handler/auth/MyBMWTokenController.java | 2 +- .../binding/nikobus/internal/utils/Utils.java | 1 - .../internal/api/NapierCityCouncil.java | 1 - .../api/OpenSprinklerHttpApiV100.java | 4 +-- .../phc/internal/handler/PHCHandler.java | 1 - .../pilight/internal/PilightConnector.java | 1 - .../protocol/serial/SerialAvrConnection.java | 1 - .../qbus/internal/QbusBridgeHandler.java | 1 - .../internal/protocol/QbusCommunication.java | 4 --- .../messages/RFXComEnergyMessage.java | 2 +- .../RFXComInterfaceControlMessage.java | 2 +- .../messages/RFXComLighting1Message.java | 2 +- .../messages/RFXComLighting5Message.java | 2 +- .../internal/messages/RFXComRawMessage.java | 2 +- .../messages/RFXComSecurity1Message.java | 2 +- .../internal/messages/RFXComUVMessage.java | 2 +- .../messages/RFXComRawMessageTest.java | 2 +- .../internal/handler/SerialThingHandler.java | 2 -- .../OH-INF/thing/aws-salus-bridge.xml | 5 ++- .../resources/OH-INF/thing/salus-bridge.xml | 5 ++- .../resources/OH-INF/thing/thing-types.xml | 2 +- .../internal/handler/SamsungTvHandler.java | 33 +++++++++---------- .../sensibo/internal/SensiboModelTest.java | 1 - .../internal/handler/HTTPHandler.java | 1 - .../type/TimeOfDayTypeConverter.java | 7 ++-- .../SiemensHvacBridgeThingHandler.java | 1 - .../handler/SiemensHvacHandlerImpl.java | 2 -- .../SiemensHvacMetadataDataPoint.java | 1 - .../SiemensHvacMetadataRegistryImpl.java | 15 +-------- .../network/SiemensHvacConnectorImpl.java | 3 -- .../network/SiemensHvacRequestListener.java | 1 - .../solarmax/internal/SolarMaxHandler.java | 1 - .../main/resources/OH-INF/thing/channels.xml | 4 +-- .../SonyProjectorDiscoveryParticipant.java | 1 - .../internal/synop/SynopLand.java | 1 - .../internal/synop/WindDirections.java | 1 - .../internal/coe/TACmiCoEBridgeHandler.java | 1 - .../tacmi/internal/message/AnalogValue.java | 2 +- .../swagger/codegen/api/client/HomeApi.java | 13 -------- .../org.openhab.binding.teleinfo/README.md | 2 +- .../binding/velux/internal/VeluxBinding.java | 1 - .../internal/handler/VigiCruesHandler.java | 2 +- .../internal/client/DescriptionLoader.java | 2 +- .../handler/AbstractWiFiLEDDriver.java | 4 +-- .../handler/ClassicWiFiLEDDriver.java | 2 +- .../internal/handler/FadingWiFiLEDDriver.java | 2 +- .../internal/handler/WiFiLEDHandler.java | 2 +- .../internal/handler/LEDStateDTOTest.java | 2 +- .../protocol/xml/DeviceInformationXML.java | 1 - .../xml/InputWithTunerDABControlXML.java | 3 +- .../internal/protocol/xml/XMLConnection.java | 1 - .../internal/protocol/xml/ZoneControlXML.java | 9 +++-- .../internal/state/DabBandState.java | 3 +- .../internal/state/DabBandStateListener.java | 3 +- .../internal/state/Invalidateable.java | 3 +- .../internal/profiles/StateFilterProfile.java | 6 ++-- .../profiles/StateFilterProfileTest.java | 33 ++++++++++++------- .../googletts/internal/GoogleTTSVoice.java | 4 +-- .../voice/mactts/internal/MacTTSService.java | 6 ++-- .../voice/marytts/internal/MaryTTSVoice.java | 4 +-- .../pollytts/internal/PollyTTSVoice.java | 4 +-- .../voicerss/internal/VoiceRSSVoice.java | 4 +-- .../openhab/binding/ntp/test/NtpOSGiTest.java | 2 +- 107 files changed, 146 insertions(+), 216 deletions(-) diff --git a/bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/config/config.xml index cd8e4f8723e..c35ee84520c 100644 --- a/bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/config/config.xml @@ -26,7 +26,7 @@ = and then the standard RubyGems version constraint, such as "openhab-scripting=~>5.0". + = and then the standard RubyGems version constraint, such as "openhab-scripting=~>5.0". ]]> openhab-scripting=~>5.0.0 diff --git a/bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelper.java b/bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelper.java index 4fbd5f2b4f1..587e8f8c285 100644 --- a/bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelper.java +++ b/bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelper.java @@ -38,7 +38,7 @@ public class DynamicChannelHelper { private record ConfigurationChannel(String id, String typeId, String itemType) { } - private final static List channels = new ArrayList() { + private static final List CHANNELS = new ArrayList() { { add(new ConfigurationChannel(CHANNEL_COUNTRY_CODE, CHANNEL_COUNTRY_CODE, "String")); add(new ConfigurationChannel(CHANNEL_PM_STANDARD, CHANNEL_PM_STANDARD, "String")); @@ -58,10 +58,10 @@ public class DynamicChannelHelper { } }; - private final static Logger logger = LoggerFactory.getLogger(DynamicChannelHelper.class); + private static final Logger logger = LoggerFactory.getLogger(DynamicChannelHelper.class); public static ThingBuilder updateThingWithConfigurationChannels(Thing thing, ThingBuilder builder) { - for (ConfigurationChannel channel : channels) { + for (ConfigurationChannel channel : CHANNELS) { addLocalConfigurationChannel(thing, builder, channel); } diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java index 84b7a37d8bd..da3354d4675 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java @@ -21,7 +21,12 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.astro.internal.calc.SunCalc; import org.openhab.binding.astro.internal.job.DailyJobSun; import org.openhab.binding.astro.internal.job.Job; -import org.openhab.binding.astro.internal.model.*; +import org.openhab.binding.astro.internal.model.Planet; +import org.openhab.binding.astro.internal.model.Position; +import org.openhab.binding.astro.internal.model.Radiation; +import org.openhab.binding.astro.internal.model.Range; +import org.openhab.binding.astro.internal.model.Sun; +import org.openhab.binding.astro.internal.model.SunPhaseName; import org.openhab.core.i18n.TimeZoneProvider; import org.openhab.core.scheduler.CronScheduler; import org.openhab.core.thing.Thing; diff --git a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java index b62909d740f..3eb99114018 100644 --- a/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java +++ b/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java @@ -207,7 +207,6 @@ public class AwattarBridgeHandler extends BaseBridgeHandler { // refresh then every 3 hours, if the last refresh was more than an hour ago if (now.getHour() % 3 == 0 && lastRefresh.getEpochSecond() < now.minusHours(1).toEpochSecond()) { - // update the last refresh time lastRefresh = Instant.now(); diff --git a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerRefreshTest.java b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerRefreshTest.java index d7f67bda989..879fc437e67 100644 --- a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerRefreshTest.java +++ b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerRefreshTest.java @@ -73,7 +73,6 @@ class AwattarBridgeHandlerRefreshTest extends JavaTest { @BeforeEach public void setUp() throws IllegalArgumentException, IllegalAccessException { - when(timeZoneProviderMock.getTimeZone()).thenReturn(ZoneId.of("GMT+2")); when(bridgeMock.getUID()).thenReturn(BRIDGE_UID); diff --git a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerTest.java b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerTest.java index 5c1ce6c705e..819174b2aef 100644 --- a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerTest.java +++ b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerTest.java @@ -95,7 +95,6 @@ public class AwattarBridgeHandlerTest extends JavaTest { @BeforeEach public void setUp() throws IOException, IllegalArgumentException, IllegalAccessException, AwattarApiException { - // mock the API response try (InputStream inputStream = AwattarBridgeHandlerTest.class.getResourceAsStream("api_response.json")) { SortedSet result = new TreeSet<>(Comparator.comparing(AwattarPrice::timerange)); diff --git a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveGen1Handler.java b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveGen1Handler.java index 6123bcf3fe9..cffab0a3c5c 100644 --- a/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveGen1Handler.java +++ b/bundles/org.openhab.binding.bluetooth.airthings/src/main/java/org/openhab/binding/bluetooth/airthings/internal/AirthingsWaveGen1Handler.java @@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory; * The {@link AirthingsWaveGen1Handler} is responsible for handling commands, which are * sent to one of the channels. * - * @author Davy Wong - Added Airthings Wave Gen 1 support + * @author Davy Wong - initial contribution, added Airthings Wave Gen 1 support */ @NonNullByDefault public class AirthingsWaveGen1Handler extends AbstractAirthingsHandler { diff --git a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/MadokaValue.java b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/MadokaValue.java index 2558ba89196..63d1e4022a1 100644 --- a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/MadokaValue.java +++ b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/main/java/org/openhab/binding/bluetooth/daikinmadoka/internal/model/MadokaValue.java @@ -91,7 +91,6 @@ public class MadokaValue { // unsupported break; } - } return 0; } diff --git a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothChannelUtils.java b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothChannelUtils.java index 7c161eb2961..47be517e4d6 100644 --- a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothChannelUtils.java +++ b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothChannelUtils.java @@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory; /** * The {@link BluetoothChannelUtils} contains utility functions used by the GattChannelHandler * - * @author Vlad Kolotov - Original author + * @author Vlad Kolotov - Initial contribution * @author Connor Petty - Modified for openHAB use */ @NonNullByDefault @@ -75,11 +75,11 @@ public class BluetoothChannelUtils { case SINT: case FLOAT_IEE754: case FLOAT_IEE11073: - BluetoothUnit unit = BluetoothUnit.findByType(field.getUnit()); - if (unit != null) { - // TODO - // return "Number:" + unit.getUnit().getDimension(); - } + // BluetoothUnit unit = BluetoothUnit.findByType(field.getUnit()); + // if (unit != null) { + // TODO + // return "Number:" + unit.getUnit().getDimension(); + // } return "Number"; case UTF8S: case UTF16S: @@ -208,7 +208,7 @@ public class BluetoothChannelUtils { if (decimalType != null) { try { return field.getEnumeration(new BigInteger(decimalType.toString())); - } catch (NumberFormatException ex) { + } catch (NumberFormatException ignored) { // do nothing } } diff --git a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java index dd20532b4d3..ca53b0bb9b5 100644 --- a/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java +++ b/bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java @@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory; /** * {@link CharacteristicChannelTypeProvider} that provides channel types for dynamically discovered characteristics. * - * @author Vlad Kolotov - Original author + * @author Vlad Kolotov - Initial contribution * @author Connor Petty - Modified for openHAB use. */ @NonNullByDefault diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java index d8130c0565f..4acc3951b19 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java @@ -47,7 +47,7 @@ import gnu.io.UnsupportedCommOperationException; * Driver for the CM11 X10 interface. * * - * @author Anthony Green - Original code + * @author Anthony Green - Initial contribution * @author Bob Raker - updates to setClock code, adapted code for use in openHAB2 * @see CM11 Protocol specification * @see RXTX Serial API for Java diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java index 2f9f0e16453..1f3c916960c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java @@ -113,7 +113,6 @@ public class SceneDiscoveryService extends AbstractDiscoveryService { .withBridge(bridgeUID).withLabel(scene.getSceneName()).build(); thingDiscovered(discoveryResult); - } else { logger.debug("discovered unsupported scene: name '{}' with id {}", scene.getSceneName(), scene.getID()); diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java index 0935228cf0e..acdc134c0de 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java @@ -47,8 +47,8 @@ import org.slf4j.LoggerFactory; * For that it uses the {@link BridgeHandler} to register this class as a {@link DeviceStatusListener} to get informed * about changes from the accompanying {@link Circuit}. * - * @author Michael Ochel - * @author Matthias Siegele + * @author Michael Ochel - Initial contribution + * @author Matthias Siegele - Initial contribution */ public class CircuitHandler extends BaseThingHandler implements DeviceStatusListener { diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java index b3ce104d06d..159f917b8d9 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java @@ -16,8 +16,8 @@ package org.openhab.binding.digitalstrom.internal.lib.serverconnection.constants * The {@link JSONApiResponseKeysEnum} contains digitalSTROM-JSON response keys. * * @author Alexander Betker - Initial contribution - * @author Michael Ochel completely changed and updated only methods remained - * @author Matthias Siegele completely changed and updated only methods remained + * @author Michael Ochel - completely changed and updated only methods remained + * @author Matthias Siegele - completely changed and updated only methods remained */ public enum JSONApiResponseKeysEnum { diff --git a/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/ControllerHandler.java b/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/ControllerHandler.java index 6abf84e7f98..86adfb39b88 100644 --- a/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/ControllerHandler.java +++ b/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/ControllerHandler.java @@ -112,7 +112,7 @@ public class ControllerHandler extends DraytonWiserThingHandler } private State getHeatChannel1Demand() { - return getData().heatingChannels.size() >= 1 + return !getData().heatingChannels.isEmpty() ? new QuantityType<>(getData().heatingChannels.get(0).getPercentageDemand(), Units.PERCENT) : UnDefType.UNDEF; } @@ -124,7 +124,7 @@ public class ControllerHandler extends DraytonWiserThingHandler } private State getHeatChannel1DemandState() { - return OnOffType.from(getData().heatingChannels.size() >= 1 + return OnOffType.from(!getData().heatingChannels.isEmpty() && "ON".equalsIgnoreCase(getData().heatingChannels.get(0).getHeatingRelayState())); } diff --git a/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/HotWaterHandler.java b/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/HotWaterHandler.java index ed8a0221e4f..5c3aa3af81c 100644 --- a/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/HotWaterHandler.java +++ b/bundles/org.openhab.binding.draytonwiser/src/main/java/org/openhab/binding/draytonwiser/internal/handler/HotWaterHandler.java @@ -110,7 +110,7 @@ public class HotWaterHandler extends DraytonWiserThingHandler { } private State getBoostedState() { - if (getData().hotWater.size() >= 1) { + if (!getData().hotWater.isEmpty()) { final HotWaterDTO firstChannel = getData().hotWater.get(0); if (firstChannel.getOverrideTimeoutUnixTime() != null @@ -125,7 +125,7 @@ public class HotWaterHandler extends DraytonWiserThingHandler { } private State getBoostRemainingState() { - if (getData().hotWater.size() >= 1) { + if (!getData().hotWater.isEmpty()) { final HotWaterDTO firstChannel = getData().hotWater.get(0); final Integer overrideTimeout = firstChannel.getOverrideTimeoutUnixTime(); diff --git a/bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/GenericResponseTransformer.java b/bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/GenericResponseTransformer.java index fbf26aa3f77..98a1bb2807d 100644 --- a/bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/GenericResponseTransformer.java +++ b/bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/GenericResponseTransformer.java @@ -121,7 +121,6 @@ public class GenericResponseTransformer { // call the custom handler to handle specific / composite channels which do not map 1:1 to JSON // fields. result.putAll(customResponseTransformer.transform(channel, value, jsonData)); - } catch (NumberFormatException | DateTimeParseException ex) { logger.warn("caught exception while parsing data for channel {} (value '{}'). Exception: {}", channel.getUID().getId(), value, ex.getMessage()); diff --git a/bundles/org.openhab.binding.emotiva/src/main/java/org/openhab/binding/emotiva/internal/EmotivaProcessorHandler.java b/bundles/org.openhab.binding.emotiva/src/main/java/org/openhab/binding/emotiva/internal/EmotivaProcessorHandler.java index 9dceae4aecb..9b1d07becf0 100644 --- a/bundles/org.openhab.binding.emotiva/src/main/java/org/openhab/binding/emotiva/internal/EmotivaProcessorHandler.java +++ b/bundles/org.openhab.binding.emotiva/src/main/java/org/openhab/binding/emotiva/internal/EmotivaProcessorHandler.java @@ -328,7 +328,6 @@ public class EmotivaProcessorHandler extends BaseThingHandler { if (object instanceof EmotivaAckDTO answerDto) { // Currently not supported to revert a failed command update, just used for logging for now. logger.trace("Processing received '{}' with '{}'", EmotivaAckDTO.class.getSimpleName(), answerDto); - } else if (object instanceof EmotivaBarNotifyWrapper answerDto) { logger.trace("Processing received '{}' with '{}'", EmotivaBarNotifyWrapper.class.getSimpleName(), emotivaUdpResponse.answer()); diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/channels.xml index 966f1752808..62a71eabaaf 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/channels.xml @@ -438,14 +438,14 @@ - Number:Duration + Number:Time Automatically switch to off - Number:Duration + Number:Time Delay switch off by radio for given seconds diff --git a/bundles/org.openhab.binding.enphase/src/main/java/org/openhab/binding/enphase/internal/handler/EnvoyEntrezConnector.java b/bundles/org.openhab.binding.enphase/src/main/java/org/openhab/binding/enphase/internal/handler/EnvoyEntrezConnector.java index 30c3976e244..d296cc94124 100644 --- a/bundles/org.openhab.binding.enphase/src/main/java/org/openhab/binding/enphase/internal/handler/EnvoyEntrezConnector.java +++ b/bundles/org.openhab.binding.enphase/src/main/java/org/openhab/binding/enphase/internal/handler/EnvoyEntrezConnector.java @@ -79,7 +79,6 @@ public class EnvoyEntrezConnector extends EnvoyConnector { check(configuration.password, "Password parameter is empty"), check(configuration.siteName, "siteName parameter is empty")) .filter(s -> !s.isEmpty()).collect(Collectors.joining(", ")); - } if (!message.isEmpty()) { return message; diff --git a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/config/bridge-config.xml b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/config/bridge-config.xml index f0db723ae4a..73cf45aba03 100644 --- a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/config/bridge-config.xml +++ b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/config/bridge-config.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 - https://openhab.org/schemas/config-description-1.0.0.xsd"> + https://openhab.org/schemas/config-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java index 4c66dbf6160..dd90407f1be 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java @@ -22,8 +22,8 @@ import org.eclipse.jetty.client.HttpClient; * Class representing an internet radio based on the frontier silicon chipset. Tested with "hama IR110" and Medion * MD87180" internet radios. * - * @author Rainer Ostendorf - * @author Patrick Koenemann + * @author Rainer Ostendorf - Initial contribution + * @author Patrick Koenemann - improvements * @author Mihaela Memova - removed duplicated check for the percent value range */ public class FrontierSiliconRadio { diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java index 464318ea250..63345da3ebf 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java @@ -43,8 +43,8 @@ import org.xml.sax.SAXException; * * This class parses this XML data and provides functions for reading and casting typical fields. * - * @author Rainer Ostendorf - * @author Patrick Koenemann + * @author Rainer Ostendorf - Initial contribution + * @author Patrick Koenemann - Improvements * */ public class FrontierSiliconRadioApiResult { diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java index 756ad47a6d8..3a29cbc1494 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java @@ -26,8 +26,8 @@ import org.slf4j.LoggerFactory; /** * This class holds the http-connection and session information for controlling the radio. * - * @author Rainer Ostendorf - * @author Patrick Koenemann + * @author Rainer Ostendorf - Initial contribution + * @author Patrick Koenemann - improvements * @author Svilen Valkanov - replaced Apache HttpClient with Jetty * @author Mihaela Memova - changed the calling of the stopHttpClient() method, fixed the hardcoded URL path, fixed the * for loop condition part @@ -110,7 +110,6 @@ public class FrontierSiliconRadioConnection { isLoggedIn = true; return true; // login successful :-) } - } catch (Exception e) { logger.debug("Fatal transport error: {}", e.toString()); throw new IOException(e); diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java index 0244c080155..9c3475c7b31 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java @@ -15,7 +15,7 @@ package org.openhab.binding.fsinternetradio.internal.radio; /** * Internal constants for the frontier silicon radio. * - * @author Markus Rathgeb - Moved the constants to separate class + * @author Markus Rathgeb - Initial contribution, moved the constants to separate class */ public class FrontierSiliconRadioConstants { diff --git a/bundles/org.openhab.binding.groupepsa/src/main/java/org/openhab/binding/groupepsa/internal/things/GroupePSAHandler.java b/bundles/org.openhab.binding.groupepsa/src/main/java/org/openhab/binding/groupepsa/internal/things/GroupePSAHandler.java index 54faf94b02a..4018ae5110d 100644 --- a/bundles/org.openhab.binding.groupepsa/src/main/java/org/openhab/binding/groupepsa/internal/things/GroupePSAHandler.java +++ b/bundles/org.openhab.binding.groupepsa/src/main/java/org/openhab/binding/groupepsa/internal/things/GroupePSAHandler.java @@ -154,7 +154,6 @@ public class GroupePSAHandler extends BaseThingHandler { this.onlineIntervalM = onlineIntervalM != null ? onlineIntervalM : DEFAULT_ONLINE_INTERVAL_M; startGroupePSAPolling(pollingIntervalM); } - } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED); } @@ -359,7 +358,6 @@ public class GroupePSAHandler extends BaseThingHandler { Charging::getRemainingTime, x -> new BigDecimal(x.getSeconds()), Units.SECOND); updateState(CHANNEL_ELECTRIC_CHARGING_NEXTDELAYEDTIME, energy, Energy::getCharging, Charging::getNextDelayedTime, x -> new BigDecimal(x.getSeconds()), Units.SECOND); - } } } diff --git a/bundles/org.openhab.binding.growatt/src/main/java/org/openhab/binding/growatt/internal/cloud/GrowattCloud.java b/bundles/org.openhab.binding.growatt/src/main/java/org/openhab/binding/growatt/internal/cloud/GrowattCloud.java index 4d3eeaa758d..04b577cc4e3 100644 --- a/bundles/org.openhab.binding.growatt/src/main/java/org/openhab/binding/growatt/internal/cloud/GrowattCloud.java +++ b/bundles/org.openhab.binding.growatt/src/main/java/org/openhab/binding/growatt/internal/cloud/GrowattCloud.java @@ -508,7 +508,6 @@ public class GrowattCloud implements AutoCloseable { DeviceType deviceType = getDeviceTypeChecked(deviceId); switch (deviceType) { - case MIX: case SPA: setTimeProgram(deviceId, deviceType, diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/AuthenticationHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/AuthenticationHandler.java index 33152e38662..27a6d156492 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/AuthenticationHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/AuthenticationHandler.java @@ -23,7 +23,7 @@ import org.openhab.core.i18n.ConfigurationException; /** * Handles the authentication to Homematic server. * - * @author Christian Kittel + * @author Christian Kittel - Initial contribution */ @NonNullByDefault public class AuthenticationHandler { diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java index acc172422f0..91405efb9fb 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java @@ -123,7 +123,6 @@ public class HomematicDeviceDiscoveryService thingHandler.getGateway().setInstallMode(false, 0); } } - } catch (Exception ex) { logger.warn("Failed to disable Homematic controller's install mode", ex); } diff --git a/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardDeviceHandler.java b/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardDeviceHandler.java index 7444fa4f858..9e9f74ff604 100644 --- a/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardDeviceHandler.java +++ b/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardDeviceHandler.java @@ -103,7 +103,7 @@ public abstract class HomeWizardDeviceHandler extends BaseThingHandler { * * @param payload The data parsed from the data Json file */ - abstract protected void handleDataPayload(DataPayload payload); + protected abstract void handleDataPayload(DataPayload payload); /** * diff --git a/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardStatefulDeviceHandler.java b/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardStatefulDeviceHandler.java index 36c942c1ee8..11197b7f9f7 100644 --- a/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardStatefulDeviceHandler.java +++ b/bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardStatefulDeviceHandler.java @@ -47,7 +47,7 @@ public abstract class HomeWizardStatefulDeviceHandler extends HomeWizardDeviceHa * * @param payload The data parsed from the state Json file */ - abstract protected void handleStatePayload(StatePayload payload); + protected abstract void handleStatePayload(StatePayload payload); protected void pollState() { final String stateResult; diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2BridgeHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2BridgeHandler.java index 37f7c6e8f79..300acb703ae 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2BridgeHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2BridgeHandler.java @@ -119,7 +119,7 @@ public class Clip2BridgeHandler extends BaseBridgeHandler { private final Bundle bundle; private final LocaleProvider localeProvider; private final TranslationProvider translationProvider; - private final Map automationsCache = new ConcurrentHashMap<>();; + private final Map automationsCache = new ConcurrentHashMap<>(); private final Set automationScriptIds = ConcurrentHashMap.newKeySet(); private final ChannelGroupUID automationChannelGroupUID; @@ -853,7 +853,6 @@ public class Clip2BridgeHandler extends BaseBridgeHandler { Resource cachedAutomation = automationsCache.get(automation.getId()); return Objects.isNull(cachedAutomation) || !automation.getName().equals(cachedAutomation.getName()); })) { - synchronized (automationsCache) { automationsCache.clear(); automationsCache.putAll(automations.stream().collect(Collectors.toMap(a -> a.getId(), a -> a))); diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java index 358a9ade30c..5b4cbed88b4 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java @@ -140,7 +140,6 @@ public class ICloudDeviceHandler extends BaseThingHandler implements ICloudDevic if (channelId.equals(FIND_MY_PHONE)) { if (command == OnOffType.ON) { try { - if (deviceInformationRecord == null) { this.logger .debug("Can't send Find My Device request, because deviceInformationRecord is null!"); diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java index 1a112c33107..51206dee5c2 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java @@ -117,7 +117,6 @@ public class PushButtonToCommandProfile implements TriggerProfile { logger.warn("Parameter '{}' is not a valid command type, using default value '{}'", param, defValue); retval = defValue; } - } else { logger.debug("Parameter '{}' is not of type String, using default value '{}'", param, defValue); retval = defValue; diff --git a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/driver/Port.java b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/driver/Port.java index 102250a1177..85b0bd1119d 100644 --- a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/driver/Port.java +++ b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/driver/Port.java @@ -444,7 +444,6 @@ public class Port { logger.trace("retransmitting msg: {}", msg); ioStream.write(msg.getData()); } - } // if rate limited, need to sleep now. if (msg.getQuietTime() > 0) { diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/OH-INF/thing/Channels.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/OH-INF/thing/Channels.xml index be0053110a9..6b4e847ce10 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/OH-INF/thing/Channels.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/OH-INF/thing/Channels.xml @@ -819,7 +819,7 @@ - Number:ElectricalPotential + Number:ElectricPotential Current battery voltage Energy diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/cloud/CloudConnector.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/cloud/CloudConnector.java index 03e30718419..23c2bb8c36d 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/cloud/CloudConnector.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/cloud/CloudConnector.java @@ -194,7 +194,7 @@ public class CloudConnector { try { JsonObject homelistInfo = cl.getHomeList(country.trim().toLowerCase()); final HomeListDTO homelist = GSON.fromJson(homelistInfo, HomeListDTO.class); - if (homelist != null && homelist.getHomelist() != null && homelist.getHomelist().size() > 0) { + if (homelist != null && homelist.getHomelist() != null && !homelist.getHomelist().isEmpty()) { homeLists.put(country, homelist); } } catch (JsonSyntaxException e) { diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java index 833d043f9fa..2ce054cf682 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java @@ -323,7 +323,6 @@ public class ModbusDataThingHandler extends BaseThingHandler { int writeStartRelative = writeStart - pollStart; data = new ModbusRegisterArray(allMutatedBytes[writeStartRelative * 2], allMutatedBytes[writeStartRelative * 2 + 1]); - } else { data = ModbusBitUtilities.commandToRegisters(transformedCommand, writeValueType); } diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/profiles/ModbusGainOffsetProfile.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/profiles/ModbusGainOffsetProfile.java index 88e30604725..156274a5a49 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/profiles/ModbusGainOffsetProfile.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/profiles/ModbusGainOffsetProfile.java @@ -157,7 +157,6 @@ public class ModbusGainOffsetProfile> implements StateProf result = applyGainTowardsItem(offsetted, gain); } else { result = applyGainTowardsHandler(quantityState, gain).subtract(pregainOffsetQt); - } } catch (UnconvertibleException | UnsupportedOperationException e) { logger.warn( diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/OH-INF/thing/thing-data.xml b/bundles/org.openhab.binding.modbus/src/main/resources/OH-INF/thing/thing-data.xml index c5d1f0f3680..0074c771ab1 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/OH-INF/thing/thing-data.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/OH-INF/thing/thing-data.xml @@ -48,7 +48,7 @@
Any other value than the above types will be interpreted as static text, in which case the actual content of the polled value is ignored.
Multiple transformations can be chained by listing each transformation on a separate line, - or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]> + or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]> default @@ -103,9 +103,9 @@

Use "default" to communicate that no transformation is done and value should be passed as is.
Use SERVICENAME(ARG) or SERVICENAME:ARG to use transformation service.
Any other value than the above types will be interpreted as static text, in which case the actual content of the command - value is ignored. + value is ignored.
Multiple transformations can be chained by listing each transformation on a separate line, - or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]> + or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]> default
diff --git a/bundles/org.openhab.binding.mqtt.espmilighthub/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.mqtt.espmilighthub/src/main/resources/OH-INF/config/config.xml index 6a809ff12ad..a8444bcb8df 100644 --- a/bundles/org.openhab.binding.mqtt.espmilighthub/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.mqtt.espmilighthub/src/main/resources/OH-INF/config/config.xml @@ -50,7 +50,7 @@ this link for more information on how this is calculated. ]]> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java index 2ba8ad2aa1b..62361348d26 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java @@ -364,7 +364,6 @@ public class ChannelState implements MqttMessageSubscriber { // Only pass numeric value for QuantityType. if (mqttCommandValue instanceof QuantityType qtCommandValue) { cValue = new DecimalType(qtCommandValue.toBigDecimal()); - } String commandString = mqttFormatter.getMQTTpublishValue(cValue, "%s"); Optional transformedValue = outgoingTransformation.apply(commandString); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/OH-INF/config/config.xml index 55e5bd47284..49068e5680f 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/OH-INF/config/config.xml @@ -10,11 +10,11 @@ true online to homeassistant/status when discovering Home Assistant - things in order to trigger devices to publish up-to-date discovery information. - If you also run Home Assistant and other services that depend on knowing if Home - Assistant is not running, then it's possible for those services to be out-of-sync with - the actual status of Home Assistant, and you may want to disable this. + Publish online to homeassistant/status when discovering Home Assistant + things in order to trigger devices to publish up-to-date discovery information. + If you also run Home Assistant and other services that depend on knowing if Home + Assistant is not running, then it's possible for those services to be out-of-sync with + the actual status of Home Assistant, and you may want to disable this. ]]> diff --git a/bundles/org.openhab.binding.mqtt.ruuvigateway/src/main/java/org/openhab/binding/mqtt/ruuvigateway/internal/parser/GatewayPayloadParser.java b/bundles/org.openhab.binding.mqtt.ruuvigateway/src/main/java/org/openhab/binding/mqtt/ruuvigateway/internal/parser/GatewayPayloadParser.java index 7697bc05692..e87e4b7277d 100644 --- a/bundles/org.openhab.binding.mqtt.ruuvigateway/src/main/java/org/openhab/binding/mqtt/ruuvigateway/internal/parser/GatewayPayloadParser.java +++ b/bundles/org.openhab.binding.mqtt.ruuvigateway/src/main/java/org/openhab/binding/mqtt/ruuvigateway/internal/parser/GatewayPayloadParser.java @@ -114,7 +114,6 @@ public class GatewayPayloadParser { // below // The payload length (might depend on format version ) is validated by parser.parse call throw new IllegalArgumentException("Manufacturerer data is too short"); - } if ((bytes[4] & 0xff) != 0xff) { logger.debug("Data is not representing manufacturer specific bluetooth advertisement: {}", diff --git a/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/auth/MyBMWTokenController.java b/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/auth/MyBMWTokenController.java index 303d348e774..900b7d99b23 100644 --- a/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/auth/MyBMWTokenController.java +++ b/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/auth/MyBMWTokenController.java @@ -291,7 +291,7 @@ public class MyBMWTokenController { UrlEncoded.decodeTo(encodedUrl, tokenMap, StandardCharsets.US_ASCII); final StringBuilder codeFound = new StringBuilder(); tokenMap.forEach((key, value) -> { - if (value.size() > 0) { + if (!value.isEmpty()) { String val = value.get(0); if (key.endsWith(CODE) && (val != null)) { codeFound.append(val.toString()); diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java index 07ae623cc7b..8b43aa5a1c4 100644 --- a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java @@ -51,7 +51,6 @@ public class Utils { int button = (address >> 21) & 0x07; return leftPadWithZeros(Integer.toHexString(nikobusAddress), 6) + ":" + mapButton(button); - } catch (NumberFormatException e) { return "[" + addressString + "]"; } diff --git a/bundles/org.openhab.binding.nzwateralerts/src/main/java/org/openhab/binding/nzwateralerts/internal/api/NapierCityCouncil.java b/bundles/org.openhab.binding.nzwateralerts/src/main/java/org/openhab/binding/nzwateralerts/internal/api/NapierCityCouncil.java index 7a092fbd9e5..17c4027f3ce 100644 --- a/bundles/org.openhab.binding.nzwateralerts/src/main/java/org/openhab/binding/nzwateralerts/internal/api/NapierCityCouncil.java +++ b/bundles/org.openhab.binding.nzwateralerts/src/main/java/org/openhab/binding/nzwateralerts/internal/api/NapierCityCouncil.java @@ -48,7 +48,6 @@ public class NapierCityCouncil implements WaterWebService { switch (region.toLowerCase()) { case "napier": return HOSTNAME + REGION_NAPIER; - } return ""; } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java index 28227eef950..aef47b37f67 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java @@ -382,7 +382,7 @@ class OpenSprinklerHttpApiV100 implements OpenSprinklerApi { ContentResponse response = null; int retriesLeft = Math.max(1, config.retry); boolean connectionSuccess = false; - while (connectionSuccess == false && retriesLeft > 0) { + while (!connectionSuccess && retriesLeft > 0) { retriesLeft--; try { response = withGeneralProperties(httpClient.newRequest(location)) @@ -393,7 +393,7 @@ class OpenSprinklerHttpApiV100 implements OpenSprinklerApi { e.getMessage()); } } - if (connectionSuccess == false) { + if (!connectionSuccess) { throw new CommunicationApiException("Request to OpenSprinkler device failed"); } if (response != null && response.getStatus() != HTTP_OK_CODE) { diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java index 0f2813e5549..1e3bfd2ce20 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java @@ -79,7 +79,6 @@ public class PHCHandler extends BaseThingHandler { times[1] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_2)).shortValue() * 10); times[2] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_3)).shortValue() * 10); times[3] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_4)).shortValue() * 10); - } else if (getThing().getThingTypeUID().equals(THING_TYPE_DIM)) { times[0] = (((BigDecimal) getConfig().get(DIM_TIME_1)).shortValue()); times[1] = (((BigDecimal) getConfig().get(DIM_TIME_2)).shortValue()); diff --git a/bundles/org.openhab.binding.pilight/src/main/java/org/openhab/binding/pilight/internal/PilightConnector.java b/bundles/org.openhab.binding.pilight/src/main/java/org/openhab/binding/pilight/internal/PilightConnector.java index 5ffc6405665..3779b857caf 100644 --- a/bundles/org.openhab.binding.pilight/src/main/java/org/openhab/binding/pilight/internal/PilightConnector.java +++ b/bundles/org.openhab.binding.pilight/src/main/java/org/openhab/binding/pilight/internal/PilightConnector.java @@ -137,7 +137,6 @@ public class PilightConnector implements Runnable, Closeable { connect(); } } - } catch (InterruptedException e) { logger.debug("Interrupting thread."); Thread.currentThread().interrupt(); diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java index a06953906d9..cb998dac352 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java @@ -59,7 +59,6 @@ public class SerialAvrConnection extends StreamAvrConnection { .collect(Collectors.joining(", ")); throw new IOException( "Serial port with name " + portName + " does not exist. Available port names: " + availablePorts); - } try { diff --git a/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/QbusBridgeHandler.java b/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/QbusBridgeHandler.java index 6b314c279f0..ff69436609d 100644 --- a/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/QbusBridgeHandler.java +++ b/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/QbusBridgeHandler.java @@ -123,7 +123,6 @@ public class QbusBridgeHandler extends BaseBridgeHandler { bridgePending("Waiting for Qbus client to come online"); return; } - } } } diff --git a/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/protocol/QbusCommunication.java b/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/protocol/QbusCommunication.java index 4268c42dc15..ef4cadc09a0 100644 --- a/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/protocol/QbusCommunication.java +++ b/bundles/org.openhab.binding.qbus/src/main/java/org/openhab/binding/qbus/internal/protocol/QbusCommunication.java @@ -244,7 +244,6 @@ public final class QbusCommunication extends BaseThingHandler { try { while (!Thread.currentThread().isInterrupted() && ((qMessage = reader.readLine()) != null)) { readMessage(qMessage); - } } catch (IOException e) { if (!listenerStopped) { @@ -301,7 +300,6 @@ public final class QbusCommunication extends BaseThingHandler { } if ((writer == null) || (writer.checkError())) { logger.warn("Error resending message"); - } } } @@ -551,7 +549,6 @@ public final class QbusCommunication extends BaseThingHandler { throw new IOException("Cannot read from socket, reader not connected."); } readMessage(reader.readLine()); - } else { QbusBridgeHandler handler = bridgeCallBack; if (handler != null) { @@ -584,7 +581,6 @@ public final class QbusCommunication extends BaseThingHandler { if (handler != null) { handler.bridgeOnline(); } - } else { if (handler != null) { handler.bridgeOffline(ThingStatusDetail.CONFIGURATION_ERROR, "No serial nr defined"); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java index 2a9c4bdcb92..580c3e53448 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java @@ -29,7 +29,7 @@ import org.openhab.core.types.Type; * RFXCOM data class for energy message. * * @author Unknown - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated to OH2 */ public class RFXComEnergyMessage extends RFXComBatteryDeviceMessage { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java index 24d6331484d..d3b08520ace 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java @@ -19,7 +19,7 @@ import org.openhab.core.types.Type; * RFXCOM data class for control message. * * @author Pauli Anttila - Initial contribution - * @author Mike Jagdis + * @author Mike Jagdis - Improvements */ public class RFXComInterfaceControlMessage extends RFXComBaseMessage { private byte[] data = new byte[14]; diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java index 83949cf0db9..2883bd04fd7 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java @@ -33,7 +33,7 @@ import org.openhab.core.types.UnDefType; * RFXCOM data class for lighting1 message. See X10, ARC, etc.. * * @author Evert van Es, Cycling Engineer - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated to OH2 */ public class RFXComLighting1Message extends RFXComDeviceMessageImpl { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java index 06ddc9c9345..4e9ca090d57 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java @@ -41,7 +41,7 @@ import org.openhab.core.types.UnDefType; * RFXCOM data class for lighting5 message. * * @author Paul Hampson, Neil Renaud - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated to OH2 * @author Martin van Wingerden - added support for IT and some other subtypes */ public class RFXComLighting5Message extends RFXComDeviceMessageImpl { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessage.java index 825c601ed0e..2f3fc93104a 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessage.java @@ -37,7 +37,7 @@ import org.openhab.core.util.HexUtils; /** * RFXCOM data class for raw messages. * - * @author James Hewitt-Thomas - New addition to the PRO RFXCom firmware + * @author James Hewitt-Thomas - Initial contribution, new addition to the PRO RFXCom firmware */ public class RFXComRawMessage extends RFXComDeviceMessageImpl { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java index 279e14a5499..c9805693a8a 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java @@ -32,7 +32,7 @@ import org.openhab.core.types.Type; * (i.e. X10 Security, Visonic PowerCode, Meiantech, etc.) * * @author David Kalff - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Improvements */ public class RFXComSecurity1Message extends RFXComBatteryDeviceMessage { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java index 83e39f0553a..c4423735a75 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java @@ -29,7 +29,7 @@ import org.openhab.core.types.UnDefType; /** * RFXCOM data class for UV and temperature message. * - * @author Damien Servant - OpenHAB1 version + * @author Damien Servant - Initial contribution, OpenHAB1 version * @author Mike Jagdis - Initial contribution, OpenHAB2 version */ public class RFXComUVMessage extends RFXComBatteryDeviceMessage { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessageTest.java index df56e4f9f78..29511448723 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRawMessageTest.java @@ -30,7 +30,7 @@ import org.openhab.core.util.HexUtils; /** * Test for RFXCom-binding * - * @author James Hewitt-Thomas - New addition to the PRO RFXCom firmware + * @author James Hewitt-Thomas - Initial contribution, new addition to the PRO RFXCom firmware */ @NonNullByDefault public class RFXComRawMessageTest { diff --git a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java index f4ddbbe7a4e..e9bad02098a 100644 --- a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java +++ b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java @@ -173,7 +173,6 @@ public abstract class SerialThingHandler extends BaseThingHandler implements Ser availablePorts); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, description); return; - } // initialize serial port @@ -322,7 +321,6 @@ public abstract class SerialThingHandler extends BaseThingHandler implements Ser Thread.sleep(sleep); } catch (InterruptedException e) { } - } } catch (InterruptedIOException e) { Thread.currentThread().interrupt(); diff --git a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/aws-salus-bridge.xml b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/aws-salus-bridge.xml index 3da84165530..789d7754d29 100644 --- a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/aws-salus-bridge.xml +++ b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/aws-salus-bridge.xml @@ -1,9 +1,8 @@ + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/salus-bridge.xml b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/salus-bridge.xml index 220353f9f5a..639833e5a10 100644 --- a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/salus-bridge.xml +++ b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/salus-bridge.xml @@ -1,9 +1,8 @@ + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/thing-types.xml index 3a677098608..79c7419415b 100644 --- a/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.salus/src/main/resources/OH-INF/thing/thing-types.xml @@ -84,7 +84,7 @@
- Number:Dimensionsless + Number:Dimensionless This channel type represents a generic input. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java index 3c33af56818..eb66d57705a 100755 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java @@ -86,7 +86,7 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen private static final String HTTP_ENDPOINT_V2 = "/api/v2/"; // common Samsung TV remote control ports - private final static List PORTS = List.of(55000, 1515, 7001, 15500); + private static final List PORTS = List.of(55000, 1515, 7001, 15500); private final Logger logger = LoggerFactory.getLogger(SamsungTvHandler.class); @@ -120,13 +120,13 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen @NonNullByDefault({}) public class TVProperties { class Device { - boolean FrameTVSupport; - boolean GamePadSupport; - boolean ImeSyncedSupport; - String OS; - String PowerState; - boolean TokenAuthSupport; - boolean VoiceSupport; + boolean frameTVSupport; + boolean gamePadSupport; + boolean imeSyncedSupport; + String oS; + String powerState; + boolean tokenAuthSupport; + boolean voiceSupport; String countryCode; String description; String firmwareVersion; @@ -143,22 +143,22 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen String isSupport; public boolean getFrameTVSupport() { - return Optional.ofNullable(device).map(a -> a.FrameTVSupport).orElse(false); + return Optional.ofNullable(device).map(a -> a.frameTVSupport).orElse(false); } public boolean getTokenAuthSupport() { - return Optional.ofNullable(device).map(a -> a.TokenAuthSupport).orElse(false); + return Optional.ofNullable(device).map(a -> a.tokenAuthSupport).orElse(false); } public String getPowerState() { if (!getOS().isBlank()) { - return Optional.ofNullable(device).map(a -> a.PowerState).orElse("on"); + return Optional.ofNullable(device).map(a -> a.powerState).orElse("on"); } return "off"; } public String getOS() { - return Optional.ofNullable(device).map(a -> a.OS).orElse(""); + return Optional.ofNullable(device).map(a -> a.oS).orElse(""); } public String getWifiMac() { @@ -347,10 +347,10 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen public String fetchPowerState() { logger.trace("{}: fetching TV Power State", host); TVProperties properties = fetchTVProperties(0, 2); - String PowerState = properties.getPowerState(); - setPowerState("on".equals(PowerState)); - logger.debug("{}: PowerState is: {}", host, PowerState); - return PowerState; + String powerState = properties.getPowerState(); + setPowerState("on".equals(powerState)); + logger.debug("{}: PowerState is: {}", host, powerState); + return powerState; } public boolean handleCommand(String channel, Command command, int ms) { @@ -638,7 +638,6 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen * @return true if service restated or created, false otherwise */ private synchronized boolean createService(String type, String udn) { - Optional service = findServiceInstance(type); if (service.isPresent()) { diff --git a/bundles/org.openhab.binding.sensibo/src/test/java/org/openhab/binding/sensibo/internal/SensiboModelTest.java b/bundles/org.openhab.binding.sensibo/src/test/java/org/openhab/binding/sensibo/internal/SensiboModelTest.java index 6c538b80b57..7c9650c898a 100644 --- a/bundles/org.openhab.binding.sensibo/src/test/java/org/openhab/binding/sensibo/internal/SensiboModelTest.java +++ b/bundles/org.openhab.binding.sensibo/src/test/java/org/openhab/binding/sensibo/internal/SensiboModelTest.java @@ -32,7 +32,6 @@ public class SensiboModelTest { @Test public void testCaseInsensitiveMacAddress() throws IOException { - final PodDetailsDTO rsp = wireHelper.deSerializeResponse("/get_pod_details_response.json", PodDetailsDTO.class); SensiboSky sky = new SensiboSky(rsp); diff --git a/bundles/org.openhab.binding.sensorcommunity/src/main/java/org/openhab/binding/sensorcommunity/internal/handler/HTTPHandler.java b/bundles/org.openhab.binding.sensorcommunity/src/main/java/org/openhab/binding/sensorcommunity/internal/handler/HTTPHandler.java index cc8499e4e6b..ac65505d2bb 100644 --- a/bundles/org.openhab.binding.sensorcommunity/src/main/java/org/openhab/binding/sensorcommunity/internal/handler/HTTPHandler.java +++ b/bundles/org.openhab.binding.sensorcommunity/src/main/java/org/openhab/binding/sensorcommunity/internal/handler/HTTPHandler.java @@ -73,7 +73,6 @@ public class HTTPHandler { } callback.onError(Objects.requireNonNullElse(failure, "Unknown error")); } else { - callback.onResponse(Objects.requireNonNull(getContentAsString())); } } diff --git a/bundles/org.openhab.binding.siemenshvac/src/main/java/org/openhab/binding/siemenshvac/internal/converter/type/TimeOfDayTypeConverter.java b/bundles/org.openhab.binding.siemenshvac/src/main/java/org/openhab/binding/siemenshvac/internal/converter/type/TimeOfDayTypeConverter.java index 6d02dca6d8b..a821816daae 100644 --- a/bundles/org.openhab.binding.siemenshvac/src/main/java/org/openhab/binding/siemenshvac/internal/converter/type/TimeOfDayTypeConverter.java +++ b/bundles/org.openhab.binding.siemenshvac/src/main/java/org/openhab/binding/siemenshvac/internal/converter/type/TimeOfDayTypeConverter.java @@ -73,8 +73,7 @@ public class TimeOfDayTypeConverter extends AbstractTypeConverter { if ("----".equals(value.getAsString())) { return new DateTimeType(ZonedDateTime.now(this.timeZoneProvider.getTimeZone())); } else { - - if (unit.equals("h:m")) { + if ("h:m".equals(unit)) { String st = value.getAsString(); String[] parts = st.split(":"); int h = Integer.parseInt(parts[0]); @@ -83,7 +82,7 @@ public class TimeOfDayTypeConverter extends AbstractTypeConverter { Unit - Number:DimensionLess + Number:Dimensionless A CO2 sensor carbon dioxide concentration in ppm - Number:DimensionLess + Number:Dimensionless A noise sensor noise in decibel diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/discovery/SonyProjectorDiscoveryParticipant.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/discovery/SonyProjectorDiscoveryParticipant.java index 36e30a756a3..7a6e4057f2f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/discovery/SonyProjectorDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/discovery/SonyProjectorDiscoveryParticipant.java @@ -73,7 +73,6 @@ public class SonyProjectorDiscoveryParticipant implements SddpDiscoveryParticipa if (device.manufacturer.toUpperCase(Locale.ENGLISH).contains(SONY) && device.type.toUpperCase(Locale.ENGLISH).contains(TYPE_PROJECTOR) && !device.macAddress.isBlank() && !device.ipAddress.isBlank()) { - logger.debug("Sony projector with mac {} found at {}", device.macAddress, device.ipAddress); return new ThingUID(THING_TYPE_ETHERNET, device.macAddress); } diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/SynopLand.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/SynopLand.java index 438277ace57..62a1101a838 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/SynopLand.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/SynopLand.java @@ -39,7 +39,6 @@ public class SynopLand extends Synop { } } catch (NumberFormatException ignore) { } - } } } diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/WindDirections.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/WindDirections.java index b40d3134a4a..d0e2d11da8d 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/WindDirections.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/synop/WindDirections.java @@ -44,7 +44,6 @@ public enum WindDirections { * Returns the wind direction based on degree. */ public static WindDirections getWindDirection(int degree) { - double b = Math.floor((degree + (STEP / 2.0)) / STEP); return values()[(int) (b % values().length)]; } diff --git a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/coe/TACmiCoEBridgeHandler.java b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/coe/TACmiCoEBridgeHandler.java index abd3cb718bd..995fe8a65aa 100644 --- a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/coe/TACmiCoEBridgeHandler.java +++ b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/coe/TACmiCoEBridgeHandler.java @@ -130,7 +130,6 @@ public class TACmiCoEBridgeHandler extends BaseBridgeHandler { } updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error processing data: " + e.getMessage()); - } catch (RuntimeException e) { // we catch runtime exceptions here to prevent the receiving thread to stop accidentally if // something like an IllegalStateException or NumberFormatExceptions are thrown. This indicates a diff --git a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/message/AnalogValue.java b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/message/AnalogValue.java index 30b6a81722e..fb215715178 100644 --- a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/message/AnalogValue.java +++ b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/message/AnalogValue.java @@ -19,7 +19,7 @@ import org.openhab.binding.tacmi.internal.TACmiMeasureType; * This class handles analog values as used in the analog message. * * @author Timo Wendt - Initial contribution - * @author Wolfgang Klimt + * @author Wolfgang Klimt - Improvements * @author Christian Niessner - Ported to OpenHAB2 */ @NonNullByDefault diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/swagger/codegen/api/client/HomeApi.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/swagger/codegen/api/client/HomeApi.java index 181b777112e..5eee242ad15 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/swagger/codegen/api/client/HomeApi.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/swagger/codegen/api/client/HomeApi.java @@ -61,7 +61,6 @@ public class HomeApi { } public void deleteZoneOverlay(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling deleteZoneOverlay"); @@ -103,7 +102,6 @@ public class HomeApi { } public HomeState homeState(Long homeId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling homeState"); @@ -142,7 +140,6 @@ public class HomeApi { } public List listMobileDevices(Long homeId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling listMobileDevices"); @@ -181,7 +178,6 @@ public class HomeApi { } public List listZones(Long homeId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling listZones"); @@ -220,7 +216,6 @@ public class HomeApi { } public HomeInfo showHome(Long homeId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showHome"); @@ -259,7 +254,6 @@ public class HomeApi { } public User showUser() throws IOException, ApiException { - startHttpClient(CLIENT); // create path and map variables @@ -293,7 +287,6 @@ public class HomeApi { } public GenericZoneCapabilities showZoneCapabilities(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneCapabilities"); @@ -339,7 +332,6 @@ public class HomeApi { } public OverlayTemplate showZoneDefaultOverlay(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneDefaultOverlay"); @@ -385,7 +377,6 @@ public class HomeApi { } public Zone showZoneDetails(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneDetails"); @@ -431,7 +422,6 @@ public class HomeApi { } public Overlay showZoneOverlay(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneOverlay"); @@ -477,7 +467,6 @@ public class HomeApi { } public ZoneState showZoneState(Long homeId, Long zoneId) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneState"); @@ -522,7 +511,6 @@ public class HomeApi { } public void updatePresenceLock(Long homeId, HomePresence json) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling updatePresenceLock"); @@ -565,7 +553,6 @@ public class HomeApi { } public Overlay updateZoneOverlay(Long homeId, Long zoneId, Overlay json) throws IOException, ApiException { - // verify the required parameter 'homeId' is set if (homeId == null) { throw new ApiException(400, "Missing the required parameter 'homeId' when calling updateZoneOverlay"); diff --git a/bundles/org.openhab.binding.teleinfo/README.md b/bundles/org.openhab.binding.teleinfo/README.md index 3f5243ea318..2638292ae09 100755 --- a/bundles/org.openhab.binding.teleinfo/README.md +++ b/bundles/org.openhab.binding.teleinfo/README.md @@ -105,7 +105,7 @@ Channel availability depends on the electricity connection (single or three-phas | bbrhpjw | `Number:Energy` | Total consumed energy at high rate pricing on white days | All | Tempo | | bbrhcjr | `Number:Energy` | Total consumed energy at low rate pricing on red days | All | Tempo | | bbrhpjr | `Number:Energy` | Total consumed energy at high rate pricing on red days | All | Tempo | -| pejp | `Number:Duration` | Prior notice to EJP start | All | EJP | +| pejp | `Number:Time` | Prior notice to EJP start | All | EJP | | demain | `String` | Following day color | All | Tempo | ### Standard TIC mode diff --git a/bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/VeluxBinding.java b/bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/VeluxBinding.java index 05a505b98f6..203d6a8daf2 100644 --- a/bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/VeluxBinding.java +++ b/bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/VeluxBinding.java @@ -93,7 +93,6 @@ public class VeluxBinding extends VeluxBridgeConfiguration { this.isBulkRetrievalEnabled = uncheckedConfiguration.isBulkRetrievalEnabled; this.isSequentialEnforced = uncheckedConfiguration.isSequentialEnforced; this.isProtocolTraceEnabled = uncheckedConfiguration.isProtocolTraceEnabled; - } logger.trace("VeluxBinding(constructor) done."); } diff --git a/bundles/org.openhab.binding.vigicrues/src/main/java/org/openhab/binding/vigicrues/internal/handler/VigiCruesHandler.java b/bundles/org.openhab.binding.vigicrues/src/main/java/org/openhab/binding/vigicrues/internal/handler/VigiCruesHandler.java index f60e581f830..a083a5eb656 100644 --- a/bundles/org.openhab.binding.vigicrues/src/main/java/org/openhab/binding/vigicrues/internal/handler/VigiCruesHandler.java +++ b/bundles/org.openhab.binding.vigicrues/src/main/java/org/openhab/binding/vigicrues/internal/handler/VigiCruesHandler.java @@ -131,7 +131,7 @@ public class VigiCruesHandler extends BaseThingHandler { try { HubEauResponse stationDetails = apiHandler.discoverStations(config.id); List stations = stationDetails.stations; - if (stations != null && stations.size() > 0) { + if (stations != null && !stations.isEmpty()) { stationDetails.stations.stream().findFirst().ifPresent(station -> { PointType stationLocation = new PointType( String.format(Locale.US, "%f,%f", station.latitudeStation, station.longitudeStation)); diff --git a/bundles/org.openhab.binding.webthing/src/main/java/org/openhab/binding/webthing/internal/client/DescriptionLoader.java b/bundles/org.openhab.binding.webthing/src/main/java/org/openhab/binding/webthing/internal/client/DescriptionLoader.java index 8f24072066f..bcda957d91e 100644 --- a/bundles/org.openhab.binding.webthing/src/main/java/org/openhab/binding/webthing/internal/client/DescriptionLoader.java +++ b/bundles/org.openhab.binding.webthing/src/main/java/org/openhab/binding/webthing/internal/client/DescriptionLoader.java @@ -67,7 +67,7 @@ public class DescriptionLoader { } var body = response.getContentAsString(); var description = gson.fromJson(body, WebThingDescription.class); - if ((description != null) && (description.properties != null) && (description.properties.size() > 0)) { + if ((description != null) && (description.properties != null) && !description.properties.isEmpty()) { if ((description.contextKeyword == null) || description.contextKeyword.trim().length() == 0) { description.contextKeyword = "https://webthings.io/schemas"; } diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java index 99e60f1f7a8..885b33e9335 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java @@ -30,8 +30,8 @@ import org.slf4j.LoggerFactory; * Abstract WiFi LED driver. * * @author Osman Basha - Initial contribution - * @author Stefan Endrullis - * @author Ries van Twisk + * @author Stefan Endrullis - Improvements + * @author Ries van Twisk - Improvements */ public abstract class AbstractWiFiLEDDriver { diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java index 7fa02c612bc..9da4bbb27a3 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java @@ -28,7 +28,7 @@ import org.openhab.core.library.types.StringType; * It's used for sending color or program settings and also extracting the data out of the received telegrams. * * @author Osman Basha - Initial contribution - * @author Stefan Endrullis + * @author Stefan Endrullis - Improvements * @author Ries van Twisk - Prevent flashes during classic driver color + white updates */ public class ClassicWiFiLEDDriver extends AbstractWiFiLEDDriver { diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java index 6aa63391708..4391693624d 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java @@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory; * It utilizes color fading when changing colors or turning the light on of off. * * @author Stefan Endrullis - Initial contribution - * @author Ries van Twisk + * @author Ries van Twisk - Improvements */ public class FadingWiFiLEDDriver extends AbstractWiFiLEDDriver { diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java index a1eb9febc91..b5ff20f76a9 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java @@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory; * sent to one of the channels. * * @author Osman Basha - Initial contribution - * @author Ries van Twisk + * @author Ries van Twisk - Improvements */ public class WiFiLEDHandler extends BaseThingHandler { diff --git a/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java b/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java index 594d7dbb734..3238e663948 100644 --- a/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java +++ b/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; /** * Test for LEDStateDTO * - * @author Ries van Twisk - Prevent flashes during classic driver color + white updates + * @author Ries van Twisk - Initial contribution, prevent flashes during classic driver color + white updates */ public class LEDStateDTOTest { diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java index 33c002408d3..afd53cf7d0d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java @@ -113,7 +113,6 @@ public class DeviceInformationXML implements DeviceInformation { XMLConstants.FEATURE_BY_YNC_TAG .forEach((name, feature) -> checkFeature(featureNode, name, feature, state.features)); - } else { // on older models (RX-V3900) the Feature_Existence element does not exist diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java index 3d396cde4dc..a89081ae36f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java @@ -41,7 +41,8 @@ import org.w3c.dom.Node; * No state will be saved in here, but in {@link DabBandState}, {@link PresetInfoState} and {@link PlayInfoState} * instead. * - * @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D) + * @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models + * (RX-S601D) */ public class InputWithTunerDABControlXML extends AbstractInputControlXML implements InputWithTunerBandControl, InputWithPresetControl { diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java index e32f0de0148..c3274199ba0 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java @@ -93,7 +93,6 @@ public class XMLConnection extends AbstractConnection { } return responseConsumer.apply(connection); - } finally { if (connection != null) { connection.disconnect(); diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java index 801ed5ea2ce..f1c2924c90d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java @@ -39,11 +39,11 @@ import org.w3c.dom.Node; * The zone protocol class is used to control one zone of a Yamaha receiver with HTTP/xml. * No state will be saved in here, but in {@link ZoneControlState} instead. * + * @author Tomasz Maruszak - Initial contribution, refactoring, input mapping fix, added + * Straight surround, volume DB fix and config improvement. * @author David Gräff - Refactored - * @author Eric Thill - * @author Ben Jones - * @author Tomasz Maruszak - Refactoring, input mapping fix, added Straight surround, volume DB fix and config - * improvement. + * @author Eric Thill - Unknown + * @author Ben Jones - Unknown */ public class ZoneControlXML implements ZoneControl { @@ -157,7 +157,6 @@ public class ZoneControlXML implements ZoneControl { "Surr/Pgm_Sel/Straight"); logger.debug("Zone {} - adjusting command to: {}", getZone(), surroundSelStraight); } - } catch (ReceivedMessageParseException | IOException e) { logger.debug("Could not perform feature detection for RX-V3900"); } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java index d785b99d3bd..d850ae27ade 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java @@ -17,7 +17,8 @@ import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingC /** * The band state for DAB tuners. * - * @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D) + * @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models + * (RX-S601D) */ public class DabBandState implements Invalidateable { diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java index 565f935f0cf..871762557f8 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java @@ -15,7 +15,8 @@ package org.openhab.binding.yamahareceiver.internal.state; /** * Listener for changes to {@link DabBandState} * - * @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D) + * @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models + * (RX-S601D) */ public interface DabBandStateListener { void dabBandUpdated(DabBandState msg); diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java index f857a18cfc8..a70d221f0bf 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java @@ -15,7 +15,8 @@ package org.openhab.binding.yamahareceiver.internal.state; /** * Represent object whose state can be invalidated. * - * @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D) + * @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models + * (RX-S601D) */ public interface Invalidateable { diff --git a/bundles/org.openhab.transform.basicprofiles/src/main/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfile.java b/bundles/org.openhab.transform.basicprofiles/src/main/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfile.java index e482a1ba58a..a099bc0e6b1 100644 --- a/bundles/org.openhab.transform.basicprofiles/src/main/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfile.java +++ b/bundles/org.openhab.transform.basicprofiles/src/main/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfile.java @@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory; @NonNullByDefault public class StateFilterProfile implements StateProfile { - private final static String OPERATOR_NAME_PATTERN = Stream.of(StateCondition.ComparisonType.values()) + private static final String OPERATOR_NAME_PATTERN = Stream.of(StateCondition.ComparisonType.values()) .map(StateCondition.ComparisonType::name) // We want to match the longest operator first, e.g. `GTE` before `GT` .sorted(Comparator.comparingInt(String::length).reversed()) @@ -63,13 +63,13 @@ public class StateFilterProfile implements StateProfile { // so we can have conditions against input data without needing a leading space, e.g. `GTE 0` .collect(Collectors.joining("|", "(?:(?<=\\S)\\s+|^\\s*)(?:", ")\\s")); - private final static String OPERATOR_SYMBOL_PATTERN = Stream.of(StateCondition.ComparisonType.values()) + private static final String OPERATOR_SYMBOL_PATTERN = Stream.of(StateCondition.ComparisonType.values()) .map(StateCondition.ComparisonType::symbol) // We want to match the longest operator first, e.g. `<=` before `<` .sorted(Comparator.comparingInt(String::length).reversed()) // .collect(Collectors.joining("|", "(?:", ")")); - private final static Pattern EXPRESSION_PATTERN = Pattern.compile( + private static final Pattern EXPRESSION_PATTERN = Pattern.compile( // - Without the non-greedy operator in the first capture group, // it will match `Item<` when encountering `Item<>X` condition // - Symbols may be more prevalently used, so check them first diff --git a/bundles/org.openhab.transform.basicprofiles/src/test/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfileTest.java b/bundles/org.openhab.transform.basicprofiles/src/test/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfileTest.java index e803b602aa9..9b3d5fe368b 100644 --- a/bundles/org.openhab.transform.basicprofiles/src/test/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfileTest.java +++ b/bundles/org.openhab.transform.basicprofiles/src/test/java/org/openhab/transform/basicprofiles/internal/profiles/StateFilterProfileTest.java @@ -47,8 +47,18 @@ import org.openhab.core.items.GenericItem; import org.openhab.core.items.Item; import org.openhab.core.items.ItemNotFoundException; import org.openhab.core.items.ItemRegistry; -import org.openhab.core.library.items.*; -import org.openhab.core.library.types.*; +import org.openhab.core.library.items.ContactItem; +import org.openhab.core.library.items.DimmerItem; +import org.openhab.core.library.items.NumberItem; +import org.openhab.core.library.items.RollershutterItem; +import org.openhab.core.library.items.StringItem; +import org.openhab.core.library.items.SwitchItem; +import org.openhab.core.library.types.DecimalType; +import org.openhab.core.library.types.OnOffType; +import org.openhab.core.library.types.OpenClosedType; +import org.openhab.core.library.types.PercentType; +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.thing.link.ItemChannelLink; import org.openhab.core.thing.profiles.ProfileCallback; @@ -178,14 +188,16 @@ public class StateFilterProfileTest { return item; } - private Item numberItemWithState(String itemType, String itemName, State value) { - NumberItem item = new NumberItem(itemType, itemName, null); - item.setState(value); - return item; - } + /* + * private Item numberItemWithState(String itemType, String itemName, State value) { + * NumberItem item = new NumberItem(itemType, itemName, null); + * item.setState(value); + * return item; + * } + */ @Test - public void testMultipleCondition_AllMatch() throws ItemNotFoundException { + public void testMultipleConditionAllMatch() throws ItemNotFoundException { when(mockContext.getConfiguration()) .thenReturn(new Configuration(Map.of("conditions", "ItemName eq 'Value', ItemName2 eq 'Value2'"))); when(mockItemRegistry.getItem("ItemName")).thenReturn(stringItemWithState("ItemName", "Value")); @@ -199,7 +211,7 @@ public class StateFilterProfileTest { } @Test - public void testMultipleCondition_SingleMatch() throws ItemNotFoundException { + public void testMultipleConditionSingleMatch() throws ItemNotFoundException { when(mockContext.getConfiguration()) .thenReturn(new Configuration(Map.of("conditions", "ItemName eq Value, ItemName2 eq Value2"))); when(mockItemRegistry.getItem("ItemName")).thenReturn(stringItemWithState("ItemName", "Value")); @@ -266,7 +278,7 @@ public class StateFilterProfileTest { StringType s_foo = StringType.valueOf("foo"); StringType s_NULL = StringType.valueOf("NULL"); StringType s_UNDEF = StringType.valueOf("UNDEF"); - StringType s_OPEN = StringType.valueOf("OPEN"); + // StringType s_OPEN = StringType.valueOf("OPEN"); return Stream.of( // // We should be able to check item state is/isn't UNDEF/NULL @@ -595,7 +607,6 @@ public class StateFilterProfileTest { @MethodSource public void testComparingInputStateWithValue(GenericItem linkedItem, State inputState, String operator, String value, boolean expected) throws ItemNotFoundException { - String linkedItemName = linkedItem.getName(); when(mockContext.getConfiguration()).thenReturn(new Configuration(Map.of("conditions", operator + value))); diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java index 0e5f3afd0e3..defd84e3e77 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java @@ -83,9 +83,7 @@ public class GoogleTTSVoice implements Voice { return this.label; } - /** - * {@inheritDoc} - */ + // automatically inherit doc @Override public Locale getLocale() { return this.locale; diff --git a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java index e26d9dbda7d..a5cbf6f8e41 100644 --- a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java +++ b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java @@ -39,9 +39,9 @@ import org.slf4j.LoggerFactory; * This is a TTS service implementation for Mac OS, which simply uses the "say" command from the OS. * * @author Kai Kreuzer - Initial contribution and API - * @author Pauli Antilla - * @author Kelly Davis - * @author Laurent Garnier : Implement TTS LRU cache + * @author Pauli Antilla - Improvements + * @author Kelly Davis - Improvements + * @author Laurent Garnier - Implement TTS LRU cache */ @Component(service = TTSService.class) @NonNullByDefault diff --git a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java index 5e3f91baef1..6405c67627e 100644 --- a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java +++ b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java @@ -65,9 +65,7 @@ public class MaryTTSVoice implements Voice { return label; } - /** - * {@inheritDoc} - */ + // automatically inherit doc @Override public Locale getLocale() { return locale; diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java index 83830485daf..a68c1fdf6a4 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java @@ -66,9 +66,7 @@ public class PollyTTSVoice implements Voice { return label; } - /** - * {@inheritDoc} - */ + // automatically inherit doc @Override public Locale getLocale() { return locale; diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java index d771f9677a9..15c3dee9ec8 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java @@ -74,9 +74,7 @@ public class VoiceRSSVoice implements Voice { return label; } - /** - * {@inheritDoc} - */ + // automatically inherit doc @Override public Locale getLocale() { return locale; diff --git a/itests/org.openhab.binding.ntp.tests/src/main/java/org/openhab/binding/ntp/test/NtpOSGiTest.java b/itests/org.openhab.binding.ntp.tests/src/main/java/org/openhab/binding/ntp/test/NtpOSGiTest.java index 23e1992f137..b1a91fea1f6 100644 --- a/itests/org.openhab.binding.ntp.tests/src/main/java/org/openhab/binding/ntp/test/NtpOSGiTest.java +++ b/itests/org.openhab.binding.ntp.tests/src/main/java/org/openhab/binding/ntp/test/NtpOSGiTest.java @@ -105,6 +105,7 @@ public class NtpOSGiTest extends JavaOSGiTest { private static final String ACCEPTED_ITEM_TYPE_DATE_TIME = "DateTime"; private static final String TEST_HOSTNAME = "127.0.0.1"; private static final int TEST_PORT = 9002; + private static final String WRONG_HOSTNAME = "wrong.hostname"; static SimpleNTPServer timeServer; private ChannelTypeUID channelTypeUID; @@ -465,7 +466,6 @@ public class NtpOSGiTest extends JavaOSGiTest { private void assertCommunicationError(String acceptedItemType) { Configuration configuration = new Configuration(); - final String WRONG_HOSTNAME = "wrong.hostname"; if (acceptedItemType.equals(ACCEPTED_ITEM_TYPE_DATE_TIME)) { initialize(configuration, NtpBindingConstants.CHANNEL_DATE_TIME, ACCEPTED_ITEM_TYPE_DATE_TIME, null, WRONG_HOSTNAME);