From 9012897cae063cdee469761d91ab99cbdfa04dba Mon Sep 17 00:00:00 2001 From: Hilbrand Bouwkamp Date: Mon, 9 Dec 2019 22:51:06 +0100 Subject: [PATCH] Applied spotless and removed other SAT warnings Signed-off-by: Hilbrand Bouwkamp --- bundles/org.openhab.binding.dsmr/pom.xml | 3 +- .../src/main/feature/feature.xml | 12 ++--- .../internal/device/DSMRSerialAutoDevice.java | 24 +++++----- .../device/p1telegram/P1Telegram.java | 35 ++++++++------- .../device/p1telegram/P1TelegramParser.java | 28 ++++++------ .../discovery/DSMRMeterDiscoveryService.java | 44 +++++++++---------- .../resources/ESH-INF/binding/binding.xml | 3 +- .../ESH-INF/thing/channeltypes_cooling.xml | 3 +- .../thing/channeltypes_electricity.xml | 8 ++-- .../ESH-INF/thing/channeltypes_gas.xml | 3 +- .../ESH-INF/thing/channeltypes_generic.xml | 3 +- .../thing/channeltypes_genericmeter.xml | 3 +- .../ESH-INF/thing/channeltypes_gj.xml | 3 +- .../ESH-INF/thing/channeltypes_heating.xml | 3 +- .../ESH-INF/thing/channeltypes_m3.xml | 3 +- .../ESH-INF/thing/channeltypes_water.xml | 3 +- .../resources/ESH-INF/thing/dsmr_device.xml | 3 +- .../ESH-INF/thing/meter_device_dsmr_v4.xml | 2 +- .../thing/meter_electricity_ace4000.xml | 3 +- .../thing/meter_electricity_dsmr_v2_1.xml | 3 +- .../thing/meter_electricity_dsmr_v2_2.xml | 3 +- .../thing/meter_electricity_dsmr_v3.xml | 3 +- .../resources/ESH-INF/thing/smarty_device.xml | 3 +- .../dsmr/internal/TelegramReaderUtil.java | 2 +- .../device/DSMRSerialAutoDeviceTest.java | 11 +++-- 25 files changed, 115 insertions(+), 99 deletions(-) diff --git a/bundles/org.openhab.binding.dsmr/pom.xml b/bundles/org.openhab.binding.dsmr/pom.xml index 85eb0a1c90da7..79ec9137fa231 100644 --- a/bundles/org.openhab.binding.dsmr/pom.xml +++ b/bundles/org.openhab.binding.dsmr/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 diff --git a/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml b/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml index 3c2c4b9ca019e..66dd1e0cd743c 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml @@ -1,10 +1,10 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features - - openhab-runtime-base - openhab-transport-serial - mvn:org.openhab.addons.bundles/org.openhab.binding.dsmr/${project.version} - + + openhab-runtime-base + openhab-transport-serial + mvn:org.openhab.addons.bundles/org.openhab.binding.dsmr/${project.version} + diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java index f2b4c47aa8921..a8068942f6171 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java @@ -40,18 +40,18 @@ public class DSMRSerialAutoDevice implements DSMRDevice, DSMREventListener { * Enum to keep track of the internal state of {@link DSMRSerialAutoDevice}. */ enum DeviceState { - /** - * Discovers the settings of the serial port. - */ - DISCOVER_SETTINGS, - /** - * Device is receiving telegram data from the serial port. - */ - NORMAL, - /** - * Communication with serial port isn't working. - */ - ERROR + /** + * Discovers the settings of the serial port. + */ + DISCOVER_SETTINGS, + /** + * Device is receiving telegram data from the serial port. + */ + NORMAL, + /** + * Communication with serial port isn't working. + */ + ERROR } /** diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java index d350eaa9deabb..920a4d0abe8bd 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java @@ -32,23 +32,24 @@ public class P1Telegram { * The TelegramState described the meta data of the P1Telegram */ public enum TelegramState { - /** - * OK. Telegram was successful received and CRC16 checksum is verified (CRC16 only for DSMR V4 and up) - */ - OK("P1 telegram received OK"), - /** - * CRC_ERROR. CRC16 checksum failed (only DSMR V4 and up) - */ - CRC_ERROR("CRC checksum failed for received P1 telegram"), - /** - * DATA_CORRUPTION. The P1 telegram has syntax errors. - */ - DATA_CORRUPTION("Received P1 telegram is corrupted"), - /** - * P1TelegramListener. The smarty telegram was successful received but could not be decoded because of an invalid - * encryption key. - */ - INVALID_ENCRYPTION_KEY("Failed to decrypt P1 telegram due to invalid encryption key"); + /** + * OK. Telegram was successful received and CRC16 checksum is verified (CRC16 only for DSMR V4 and up) + */ + OK("P1 telegram received OK"), + /** + * CRC_ERROR. CRC16 checksum failed (only DSMR V4 and up) + */ + CRC_ERROR("CRC checksum failed for received P1 telegram"), + /** + * DATA_CORRUPTION. The P1 telegram has syntax errors. + */ + DATA_CORRUPTION("Received P1 telegram is corrupted"), + /** + * P1TelegramListener. The smarty telegram was successful received but could not be decoded because of an + * invalid + * encryption key. + */ + INVALID_ENCRYPTION_KEY("Failed to decrypt P1 telegram due to invalid encryption key"); /** * public accessible state details diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java index 3ea47f207c3d7..b3caf47ca3eaf 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java @@ -42,20 +42,20 @@ public class P1TelegramParser implements TelegramParser { * State of the parser */ private enum State { - /** Wait for the '/' character */ - WAIT_FOR_START, - /** '/' character seen */ - HEADER, - /** Waiting for the header to end with a CR & LF */ - CRLF, - /** Handling OBIS Identifier */ - DATA_OBIS_ID, - /** Parsing OBIS value */ - DATA_OBIS_VALUE, - /** OBIS value end seen ')' */ - DATA_OBIS_VALUE_END, - /** Parsing CRC value following '!' */ - CRC_VALUE + /** Wait for the '/' character */ + WAIT_FOR_START, + /** '/' character seen */ + HEADER, + /** Waiting for the header to end with a CR & LF */ + CRLF, + /** Handling OBIS Identifier */ + DATA_OBIS_ID, + /** Parsing OBIS value */ + DATA_OBIS_VALUE, + /** OBIS value end seen ')' */ + DATA_OBIS_VALUE_END, + /** Parsing CRC value following '!' */ + CRC_VALUE } /** diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java index a53232764cdbd..8cc42aa6cc542 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java @@ -82,36 +82,36 @@ public void telegramReceived(P1Telegram telegram) { logger.debug("Detect meters from #{} objects", telegram.getCosemObjects().size()); } final Entry, Map> detectedMeters = meterDetector - .detectMeters(telegram); + .detectMeters(telegram); verifyUnregisteredCosemObjects(telegram, detectedMeters.getValue()); validateConfiguredMeters(dsmrBridgeHandler.getThing().getThings(), - detectedMeters.getKey().stream().map(md -> md.getMeterType()).collect(Collectors.toSet())); + detectedMeters.getKey().stream().map(md -> md.getMeterType()).collect(Collectors.toSet())); detectedMeters.getKey().forEach(m -> meterDiscovered(m, dsmrBridgeHandler.getThing().getUID())); } protected void verifyUnregisteredCosemObjects(P1Telegram telegram, - Map undetectedCosemObjects) { + Map undetectedCosemObjects) { if (!undetectedCosemObjects.isEmpty()) { if (undetectedCosemObjects.entrySet().stream() - .anyMatch(e -> e.getKey() == CosemObjectType.METER_EQUIPMENT_IDENTIFIER - && e.getValue().getCosemValues().entrySet().stream() - .anyMatch(cv -> cv.getValue() instanceof StringType && cv.getValue().toString().isEmpty()))) { + .anyMatch(e -> e.getKey() == CosemObjectType.METER_EQUIPMENT_IDENTIFIER + && e.getValue().getCosemValues().entrySet().stream().anyMatch( + cv -> cv.getValue() instanceof StringType && cv.getValue().toString().isEmpty()))) { // Unregistered meter detected. log to the user. reportUnregisteredMeters(); } else { reportUnrecognizedCosemObjects(undetectedCosemObjects); logger.info("There are unrecognized cosem values in the data received from the meter," - + " which means some meters might not be detected. Please report your raw data as reference: {}", - telegram.getRawTelegram()); + + " which means some meters might not be detected. Please report your raw data as reference: {}", + telegram.getRawTelegram()); } } if (!telegram.getUnknownCosemObjects().isEmpty()) { logger.info("There are unrecognized cosem values in the data received from the meter," - + " which means you have values that can't be read by a channel: {}. Please report them and your raw data as reference: {}", - telegram.getUnknownCosemObjects().stream() - .map(e -> String.format("obis id:{}, value:{}", e.getKey(), e.getValue())) - .collect(Collectors.joining(", ")), - telegram.getRawTelegram()); + + " which means you have values that can't be read by a channel: {}. Please report them and your raw data as reference: {}", + telegram.getUnknownCosemObjects().stream() + .map(e -> String.format("obis id:{}, value:{}", e.getKey(), e.getValue())) + .collect(Collectors.joining(", ")), + telegram.getRawTelegram()); } } @@ -122,7 +122,7 @@ protected void verifyUnregisteredCosemObjects(P1Telegram telegram, */ protected void reportUnrecognizedCosemObjects(Map unidentifiedCosemObjects) { unidentifiedCosemObjects - .forEach((k, v) -> logger.info("Unrecognized cosem object '{}' found in the data: {}", k, v)); + .forEach((k, v) -> logger.info("Unrecognized cosem object '{}' found in the data: {}", k, v)); } /** @@ -130,7 +130,7 @@ protected void reportUnrecognizedCosemObjects(Map */ protected void reportUnregisteredMeters() { logger.info( - "An unregistered meter has been found. Probably a new meter. Retry discovery once the meter is registered with the energy provider."); + "An unregistered meter has been found. Probably a new meter. Retry discovery once the meter is registered with the energy provider."); } /** @@ -155,10 +155,10 @@ private void validateConfiguredMeters(List things, Set con // Create list of all configured meters that are not in the detected list. If not empty meters might not be // correctly configured. final List invalidConfigured = configuredMeters.stream() - .filter(dm -> !configuredMeterTypes.contains(dm)).collect(Collectors.toList()); + .filter(dm -> !configuredMeterTypes.contains(dm)).collect(Collectors.toList()); // Create a list of all detected meters not yet configured. final List unconfiguredMeters = configuredMeterTypes.stream() - .filter(dm -> !configuredMeters.contains(dm)).collect(Collectors.toList()); + .filter(dm -> !configuredMeters.contains(dm)).collect(Collectors.toList()); if (!invalidConfigured.isEmpty()) { reportConfigurationValidationResults(invalidConfigured, unconfiguredMeters); @@ -172,12 +172,12 @@ private void validateConfiguredMeters(List things, Set con * @param unconfiguredMeters The list of meters that were detected, but not configured */ protected void reportConfigurationValidationResults(List invalidConfigured, - List unconfiguredMeters) { + List unconfiguredMeters) { logger.info( - "Possible incorrect meters configured. These are configured: {}." - + "But the following unconfigured meters are found in the data received from the meter: {}", - invalidConfigured.stream().map(m -> m.name()).collect(Collectors.joining(", ")), - unconfiguredMeters.stream().map(m -> m.name()).collect(Collectors.joining(", "))); + "Possible incorrect meters configured. These are configured: {}." + + "But the following unconfigured meters are found in the data received from the meter: {}", + invalidConfigured.stream().map(m -> m.name()).collect(Collectors.joining(", ")), + unconfiguredMeters.stream().map(m -> m.name()).collect(Collectors.joining(", "))); } public void setLocaleProvider(final LocaleProvider localeProvider) { diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml index cb8a3d6caadd0..a5fddb51f50c5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml @@ -1,5 +1,6 @@ - DSMR Binding diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml index 5aba8db01437b..53c58873a1b11 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml index e8c6af410536b..67436919487fb 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml @@ -193,15 +193,15 @@ DateTime - Timestamp when the power failure ended. There can be multiple log entries. -Each entry has its own channel (emeter_power_failure_log_timestamp*x*, *x* = 0 - 9) + Timestamp when the power failure ended. There can be multiple log entries. + Each entry has its own channel (emeter_power_failure_log_timestamp*x*, *x* = 0 - 9) Number:Time - Duration of the power failure. -Each entry has its own channel (emeter_power_failure_log_duration*x*, *x* = 0 - 9) + Duration of the power failure. + Each entry has its own channel (emeter_power_failure_log_duration*x*, *x* = 0 - 9) diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml index b5e81ef04d0f5..08927c882c8bc 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml index a7d9d47f7ce3b..84015d1216eea 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml index 18e141f632013..f7c60cc24204e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml index 915be4ede6a20..c2a2e3089b174 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml index 717ab571faeac..9bab08f6742a5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml index a15cd1abfe11f..d6958c48bd8d4 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml index 3acc7eb50a3bf..af036d88ea070 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml index 14f1cc6d2d955..1c93d46e5eb5e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml index 25adb1adc8d2a..1e951864d4937 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml @@ -7,7 +7,7 @@ - + diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml index 937985e7b48b2..fd622d40a390e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml index c576c7b793710..4f4eb0909526e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml index 6c2d99e6b927d..705c73e50b399 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml index d98e11cff2fcc..c9c7aad24153e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml index 7a9da2e565b40..2ea0a18555b1a 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml @@ -1,5 +1,6 @@ - diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java index dea925a61c35f..a85310584ba69 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java @@ -57,7 +57,7 @@ public static byte[] readRawTelegram(String telegramName) { * @return a P1Telegram object */ public static P1Telegram readTelegram(String telegramName, TelegramState expectedTelegramState) { - AtomicReference p1Telegram = new AtomicReference<>(null); + AtomicReference p1Telegram = new AtomicReference<>(); byte[] telegram = readRawTelegram(telegramName); P1TelegramParser parser = new P1TelegramParser(p1Telegram::set); diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java index ef2b4018f6647..3d99540c9a2a1 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java @@ -25,7 +25,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.io.transport.serial.PortInUseException; import org.eclipse.smarthome.io.transport.serial.SerialPort; import org.eclipse.smarthome.io.transport.serial.SerialPortEvent; @@ -66,7 +65,7 @@ public SerialPortIdentifier getIdentifier(String name) { } @Override - public @NonNull Stream<@NonNull SerialPortIdentifier> getIdentifiers() { + public Stream getIdentifiers() { return Stream.empty(); } }; @@ -87,12 +86,12 @@ public void testHandlingDataAndRestart() throws IOException, PortInUseException AtomicReference telegramRef = new AtomicReference<>(null); DSMREventListener listener = new DSMREventListener() { @Override - public void handleTelegramReceived(@NonNull P1Telegram telegram) { + public void handleTelegramReceived(P1Telegram telegram) { telegramRef.set(telegram); } @Override - public void handleErrorEvent(@NonNull DSMRConnectorErrorEvent connectorErrorEvent) { + public void handleErrorEvent(DSMRConnectorErrorEvent connectorErrorEvent) { fail("No handleErrorEvent Expected" + connectorErrorEvent); } }; @@ -120,12 +119,12 @@ public void testHandleError() throws IOException, PortInUseException { AtomicReference eventRef = new AtomicReference<>(null); DSMREventListener listener = new DSMREventListener() { @Override - public void handleTelegramReceived(@NonNull P1Telegram telegram) { + public void handleTelegramReceived(P1Telegram telegram) { fail("No telegram expected:" + telegram); } @Override - public void handleErrorEvent(@NonNull DSMRConnectorErrorEvent connectorErrorEvent) { + public void handleErrorEvent(DSMRConnectorErrorEvent connectorErrorEvent) { eventRef.set(connectorErrorEvent); } };