From a1b3f27964f3896e2c2cd57f8a2b7805c8dd6db7 Mon Sep 17 00:00:00 2001 From: Luca Calcaterra Date: Tue, 26 Oct 2021 19:00:37 +0200 Subject: [PATCH] [souliss] fix discovery issue (#11438) * Initial Contribution Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Update pom.xml spotless-apply Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Renamed healty in healthy (simple word error) Signed-off-by: Luca Calcaterra * Update thing-types.xml onOff to CamelCase Signed-off-by: Luca Calcaterra * camelCase fixed on some types Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * Update README.md Signed-off-by: Luca Calcaterra * Update README.md Signed-off-by: Luca Calcaterra * Update README.md Signed-off-by: Luca Calcaterra * Update README.md Signed-off-by: Luca Calcaterra * fixed camelCase on thhings parameters Signed-off-by: Luca Calcaterra * Update thing-types.xml fixed label cases Signed-off-by: Luca Calcaterra * Update thing-types.xml Signed-off-by: Luca Calcaterra * Revert "Update thing-types.xml" This reverts commit 5c19fbc69dee53f41d56a847bc82660192e0158c. Signed-off-by: Luca Calcaterra * Initial Contribution Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Fix some errors (Nullable issues) and pom.xml format Signed-off-by: Luca Calcaterra * Update pom.xml spotless-apply Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Update SoulissT11Handler.java Default case on switch (handlecommand ) Signed-off-by: Luca Calcaterra * added secoresend to t31 skeleton and variable smessage fix declaration Signed-off-by: Luca Calcaterra * Initial Contribution Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Update pom.xml spotless-apply Signed-off-by: Luca Calcaterra Co-Authored-By: Tonino Fazio Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java Cutted comments and uneccessary log on gw status Signed-off-by: Luca Calcaterra * Renamed healty in healthy (simple word error) Signed-off-by: Luca Calcaterra * fixed camelCase on thhings parameters Signed-off-by: Luca Calcaterra * Update thing-types.xml Signed-off-by: Luca Calcaterra * cleanup and quality code fixes Signed-off-by: Luca Calcaterra * Update SoulissBindingUDPDecoder.java fixed some npe Signed-off-by: Luca Calcaterra * npe check fix Signed-off-by: Luca Calcaterra * Update SoulissCommonCommands.java Remove comments unused code Signed-off-by: Luca Calcaterra * Update SoulissCommonCommands.java commented out code unused Signed-off-by: Luca Calcaterra * Update SoulissCommonCommands.java remove unused code commented out Signed-off-by: Luca Calcaterra * Update SoulissBindingUDPServerJob.java remove unused code comments Signed-off-by: Luca Calcaterra * Update SoulissBindingSendDispatcherJob.java fixed logger trace and remove unused code comments Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * removed completely unnecessary comments Signed-off-by: Luca Calcaterra * fixed some thing types cases Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java removed unnecessary log line Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java removed unnecessary comment Signed-off-by: Luca Calcaterra * loggers as final ! Signed-off-by: Luca Calcaterra * Update SoulissGatewayJobHealthy.java removed unnecessary logs Signed-off-by: Luca Calcaterra * Update SoulissGatewayJobPing.java removed unnecessary logs Signed-off-by: Luca Calcaterra * fixed redundancy on types checks Signed-off-by: Luca Calcaterra * Update README.md fixed examples parms Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java changed parm var name bridge Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/handler/SoulissT11Handler.java remove comments Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/handler/SoulissT12Handler.java comments removed Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/handler/SoulissT13Handler.java comments removed Co-authored-by: Matthew Skinner Signed-off-by: Luca Calcaterra * fixed thing type on README and some case on xml thing types Signed-off-by: Luca Calcaterra * Update README.md cutted part about manually thing config specs on README . Who use oh already knows it . Signed-off-by: Luca Calcaterra * Code cleanup and optimizations based on @Skinah tips Signed-off-by: Luca Calcaterra * fixes from @Skinah suggestions Signed-off-by: Luca Calcaterra * Signed-off-by: Luca Calcaterra Fixed typeid's on costants files Signed-off-by: Luca Calcaterra * various optimizations follow @Skinah tips (thanks!) Signed-off-by: Luca Calcaterra * spotless:apply fix Signed-off-by: Luca Calcaterra * fixes constants and channel id types of t31 Signed-off-by: Luca Calcaterra * Fix various NPE warnings Fixes many ... Some added suppresswarnings. Signed-off-by: Luca Calcaterra * Update SoulissGenericActionMessage.java Signed-off-by: Luca Calcaterra * Refactor handlers into souliss.internal.handler Signed-off-by: Luca Calcaterra * spoless:apply fix Signed-off-by: Luca Calcaterra * spotless:apply Signed-off-by: Luca Calcaterra * fix t19 (securesend parm ,labels and setvalue) Signed-off-by: Luca Calcaterra * Update thing-types.xml spotless:apply fix Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * spotless:apply fix Signed-off-by: Luca Calcaterra * Null checks Warnings removed (mitigated with local copy of field) - removed comments Signed-off-by: Luca Calcaterra * syntax sugar fixed of consts and section removed from README Signed-off-by: Luca Calcaterra * moved files to internal package Signed-off-by: Luca Calcaterra * Update SoulissHandlerFactory.java check types on object and not on strings Signed-off-by: Luca Calcaterra * various fixes based on @fwolter Signed-off-by: Luca Calcaterra * Gateway ip address regex on config param Signed-off-by: Luca Calcaterra * changed description of gateway ip on param Signed-off-by: Luca Calcaterra * formatted tables in README.md Signed-off-by: Luca Calcaterra * removed comments Signed-off-by: Luca Calcaterra * wip for npe checks - breaking functionality :-( Signed-off-by: Luca Calcaterra * spotless fix Author: Luca Calcaterra Signed-off-by: Luca Calcaterra * fix contrib header in some files Signed-off-by: Luca Calcaterra * reworked udp - only one bridge allowed and UDP listen only to bridge port 230 ...passing datagramsocket with soulissnetworkparameter class Signed-off-by: Luca Calcaterra * quite ok. Where to close socket in case of thread interruption ? Signed-off-by: Luca Calcaterra * wip Signed-off-by: Luca Calcaterra * wip2 Signed-off-by: Luca Calcaterra * wip3 udp receive but not on vpn Signed-off-by: Luca Calcaterra * Classes names Refactor Signed-off-by: Luca Calcaterra * wip Signed-off-by: Luca Calcaterra * wip Signed-off-by: Luca Calcaterra * replaced datagramsocket with nio socket- seems to be ok Signed-off-by: Luca Calcaterra * Update UDPListenDiscoverRunnable.java Signed-off-by: Luca Calcaterra * Fixed some null checks removed securesend option (only t11 end similar) Signed-off-by: Luca Calcaterra * dummy initial value of raw values - removed thread on decoder line Signed-off-by: Luca Calcaterra * fix t19 ex catch and broadcast function Signed-off-by: Luca Calcaterra * Reworked Config of Gateway as Class (todo check nulls...) Signed-off-by: Luca Calcaterra * Added representation property on gw - some cleanups Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java cleanup unused vars Signed-off-by: Luca Calcaterra * refactor methods of gw parameters Signed-off-by: Luca Calcaterra * WIP to remove NetworkParameter class Signed-off-by: Luca Calcaterra * wip refactor DiscoverResult Signed-off-by: Luca Calcaterra * wip remove networkparameters Signed-off-by: Luca Calcaterra * WIP remove NetworkParameter Class. Things online only on a health message Signed-off-by: Luca Calcaterra * WIP Fix Topics Signed-off-by: Luca Calcaterra * WIP2 Fix topics Signed-off-by: Luca Calcaterra * Update pom.xml upgrade binding version to 3.2 snapshot Signed-off-by: Luca Calcaterra * topics bound to bridge - seems to be ok. Signed-off-by: Luca Calcaterra * remove NetworkParameters class - topics ok but need parse rework Signed-off-by: Luca Calcaterra * code cleanup and bugs check fix Signed-off-by: Luca Calcaterra * Add node and slot to property - other fixes Signed-off-by: Luca Calcaterra * change default interval subscription -cleanup constants Signed-off-by: Luca Calcaterra * WIP WAN Address gw Signed-off-by: Luca Calcaterra * WAN option external network. Fixed Putin on commands - to test well Signed-off-by: Luca Calcaterra * cleanup - safesend check WIP Signed-off-by: Luca Calcaterra * fixed secursend for t11-18 Signed-off-by: Luca Calcaterra * WIP Fix null checks Signed-off-by: Luca Calcaterra * Update SoulissGenericHandler.java fixed wrong assignment of prop Signed-off-by: Luca Calcaterra * null checks fixes for code quality Signed-off-by: Luca Calcaterra * fixed listen port according to gw parm (default 23000) Signed-off-by: Luca Calcaterra * nuances Signed-off-by: Luca Calcaterra * Update thing-types.xml changed default values Signed-off-by: Luca Calcaterra * CommonCommands to static - other fixes . seems quite ok, remain T31 to fix (securesend) Signed-off-by: Luca Calcaterra * Update UDPListenDiscoverRunnable.java Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java changed executor imp for udp Signed-off-by: Luca Calcaterra * restored commoncommands non static Signed-off-by: Luca Calcaterra * Update SendDispatcherRunnable.java safesendcheck fix (not really) Signed-off-by: Luca Calcaterra * various nuances (sonarlint) Signed-off-by: Luca Calcaterra * Update README.md Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update README.md removed explain how oh works on example Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/README.md Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * Update bundles/org.openhab.binding.souliss/src/main/feature/feature.xml Co-authored-by: Fabian Wolter Signed-off-by: Luca Calcaterra * @fwolter various fixes Signed-off-by: Luca Calcaterra * Update SoulissT11Handler.java wrong header Signed-off-by: Luca Calcaterra * Update SoulissT11Handler.java Signed-off-by: Luca Calcaterra * fix headers descriptions before authors on all classes Signed-off-by: Luca Calcaterra * all var on begin of classes and @nullable sugar syntax Signed-off-by: Luca Calcaterra * removed @nullable on local vars Signed-off-by: Luca Calcaterra * wip comments translations and cleanup Signed-off-by: Luca Calcaterra * cleanup comments and translated them (if italian occourred) Signed-off-by: Luca Calcaterra * @fwolter suggestions for approval...various fixes Signed-off-by: Luca Calcaterra * various fixes based on @fwolter suggestions. Signed-off-by: Luca Calcaterra * various fixes based on @fwolter suggestions. Signed-off-by: Luca Calcaterra * Update SoulissGatewayHandler.java Signed-off-by: Luca Calcaterra * Update thing-types.xml Signed-off-by: Luca Calcaterra * Update UDPListenDiscoverRunnable.java hexutils usage Signed-off-by: Luca Calcaterra * Update SoulissT22Handler.java removed unused method Signed-off-by: Luca Calcaterra * Update SoulissT22Handler.java fix previous commit Signed-off-by: Luca Calcaterra * Update SoulissT11Handler.java @Nullable on configuration Signed-off-by: Luca Calcaterra * method to put bridge offline (network exception on listener) Signed-off-by: Luca Calcaterra * Update thing-types.xml changed some channels to trigger type Signed-off-by: Luca Calcaterra * WIP broken Signed-off-by: Luca Calcaterra * Update thing-types.xml spotless:apply Signed-off-by: Luca Calcaterra * various changes call super on initialize() of all handlers. Changed to QuantityType where appliable Signed-off-by: Luca Calcaterra * Update SoulissGatewayDiscovery.java added uniqueId (ip of gateway+node+slot) as representationProperty Signed-off-by: Luca Calcaterra * wip for load discovery component Signed-off-by: Luca Calcaterra * big fixes and code quality improvments Signed-off-by: Luca Calcaterra * fixes Signed-off-by: Luca Calcaterra * Update SoulissGenericHandler.java Signed-off-by: Luca Calcaterra * Update README.md wrong format .. Signed-off-by: Luca Calcaterra * fix null soulissGwHandler and code analysis Signed-off-by: Luca Calcaterra * Update SoulissGatewayDiscovery.java Comment removed Signed-off-by: Luca Calcaterra * Update SoulissGatewayDiscovery.java cleanup ... Signed-off-by: Luca Calcaterra * Update SoulissGatewayDiscovery.java reintroduced local var for avoid SAT warning Signed-off-by: Luca Calcaterra * Update SoulissGatewayDiscovery.java fix error ...nuances Signed-off-by: Luca Calcaterra Co-authored-by: Tonino Fazio Co-authored-by: Matthew Skinner Co-authored-by: Fabian Wolter --- bundles/org.openhab.binding.souliss/README.md | 1 + .../discovery/SoulissGatewayDiscovery.java | 60 +++++++++---------- .../handler/SoulissGenericHandler.java | 3 - 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/bundles/org.openhab.binding.souliss/README.md b/bundles/org.openhab.binding.souliss/README.md index c9de7cae3..c28ab59f9 100644 --- a/bundles/org.openhab.binding.souliss/README.md +++ b/bundles/org.openhab.binding.souliss/README.md @@ -300,6 +300,7 @@ Text label="Termostato soggiorno" icon="temperature" { } } ``` + ## Community Souliss is a small community and doesn't have sufficient human resources to be more active on openHAB official community. diff --git a/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/discovery/SoulissGatewayDiscovery.java b/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/discovery/SoulissGatewayDiscovery.java index 29c63acb8..e12d8fde3 100644 --- a/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/discovery/SoulissGatewayDiscovery.java +++ b/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/discovery/SoulissGatewayDiscovery.java @@ -46,8 +46,7 @@ public class SoulissGatewayDiscovery extends AbstractDiscoveryService private @Nullable ScheduledFuture discoveryJob = null; private final Logger logger = LoggerFactory.getLogger(SoulissGatewayDiscovery.class); - private @Nullable SoulissDiscoverJob soulissDiscoverRunnableClass = null; - + private @Nullable SoulissDiscoverJob soulissDiscoverRunnableClass; private @Nullable SoulissGatewayHandler soulissGwHandler; public SoulissGatewayDiscovery() { @@ -135,112 +134,113 @@ public class SoulissGatewayDiscovery extends AbstractDiscoveryService String sNodeId = node + SoulissBindingConstants.UUID_NODE_SLOT_SEPARATOR + slot; ThingUID gatewayUID = gwHandler.getThing().getUID(); + var nodeLabel = "node"; var slotLabel = "slot"; switch (typical) { case SoulissProtocolConstants.SOULISS_T11: thingUID = new ThingUID(SoulissBindingConstants.T11_THING_TYPE, gatewayUID, sNodeId); - label = "T11: node " + node + slotLabel + slot; + label = "T11: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T12: thingUID = new ThingUID(SoulissBindingConstants.T12_THING_TYPE, gatewayUID, sNodeId); - label = "T12: node " + node + slotLabel + slot; + label = "T12: " + nodeLabel + " " + " " + node + " " + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T13: thingUID = new ThingUID(SoulissBindingConstants.T13_THING_TYPE, gatewayUID, sNodeId); - label = "T13: node " + node + slotLabel + slot; + label = "T13: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T14: thingUID = new ThingUID(SoulissBindingConstants.T14_THING_TYPE, gatewayUID, sNodeId); - label = "T14: node " + node + slotLabel + slot; + label = "T14: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T16: thingUID = new ThingUID(SoulissBindingConstants.T16_THING_TYPE, gatewayUID, sNodeId); - label = "T16: node " + node + slotLabel + slot; + label = "T16: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T18: thingUID = new ThingUID(SoulissBindingConstants.T18_THING_TYPE, gatewayUID, sNodeId); - label = "T18: node " + node + slotLabel + slot; + label = "T18: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T19: thingUID = new ThingUID(SoulissBindingConstants.T19_THING_TYPE, gatewayUID, sNodeId); - label = "T19: node " + node + slotLabel + slot; + label = "T19: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T1A: thingUID = new ThingUID(SoulissBindingConstants.T1A_THING_TYPE, gatewayUID, sNodeId); - label = "T1A: node " + node + slotLabel + slot; + label = "T1A: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T21: thingUID = new ThingUID(SoulissBindingConstants.T21_THING_TYPE, gatewayUID, sNodeId); - label = "T21: node " + node + slotLabel + slot; + label = "T21: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T22: thingUID = new ThingUID(SoulissBindingConstants.T22_THING_TYPE, gatewayUID, sNodeId); - label = "T22: node " + node + slotLabel + slot; + label = "T22: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T41_ANTITHEFT_MAIN: thingUID = new ThingUID(SoulissBindingConstants.T41_THING_TYPE, gatewayUID, sNodeId); - label = "T41: node " + node + slotLabel + slot; + label = "T41: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T42_ANTITHEFT_PEER: thingUID = new ThingUID(SoulissBindingConstants.T42_THING_TYPE, gatewayUID, sNodeId); - label = "T42: node " + node + slotLabel + slot; + label = "T42: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T31: thingUID = new ThingUID(SoulissBindingConstants.T31_THING_TYPE, gatewayUID, sNodeId); - label = "T31: node " + node + slotLabel + slot; + label = "T31: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T52_TEMPERATURE_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T52_THING_TYPE, gatewayUID, sNodeId); - label = "T52: node " + node + slotLabel + slot; + label = "T52: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T53_HUMIDITY_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T53_THING_TYPE, gatewayUID, sNodeId); - label = "T53: node " + node + slotLabel + slot; + label = "T53: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T54_LUX_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T54_THING_TYPE, gatewayUID, sNodeId); - label = "T54: node " + node + slotLabel + slot; + label = "T54: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T55_VOLTAGE_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T55_THING_TYPE, gatewayUID, sNodeId); - label = "T55: node " + node + slotLabel + slot; + label = "T55: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T56_CURRENT_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T56_THING_TYPE, gatewayUID, sNodeId); - label = "T56: node " + node + slotLabel + slot; + label = "T56: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T57_POWER_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T57_THING_TYPE, gatewayUID, sNodeId); - label = "T57: node " + node + slotLabel + slot; + label = "T57: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T61: thingUID = new ThingUID(SoulissBindingConstants.T61_THING_TYPE, gatewayUID, sNodeId); - label = "T61: node " + node + slotLabel + slot; + label = "T61: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T62_TEMPERATURE_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T62_THING_TYPE, gatewayUID, sNodeId); - label = "T62: node " + node + slotLabel + slot; + label = "T62: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T63_HUMIDITY_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T63_THING_TYPE, gatewayUID, sNodeId); - label = "T63: node " + node + slotLabel + slot; + label = "T63: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T64_LUX_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T64_THING_TYPE, gatewayUID, sNodeId); - label = "T64: node " + node + slotLabel + slot; + label = "T64: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T65_VOLTAGE_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T65_THING_TYPE, gatewayUID, sNodeId); - label = "T65: node " + node + slotLabel + slot; + label = "T65: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T66_CURRENT_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T66_THING_TYPE, gatewayUID, sNodeId); - label = "T66: node " + node + slotLabel + slot; + label = "T66: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; case SoulissProtocolConstants.SOULISS_T67_POWER_SENSOR: thingUID = new ThingUID(SoulissBindingConstants.T67_THING_TYPE, gatewayUID, sNodeId); - label = "T67: node " + node + slotLabel + slot; + label = "T67: " + nodeLabel + " " + node + " " + slotLabel + " " + slot; break; default: { logger.debug("no supported things found ..."); @@ -264,8 +264,8 @@ public class SoulissGatewayDiscovery extends AbstractDiscoveryService @Override public void setThingHandler(ThingHandler handler) { if (handler instanceof SoulissGatewayHandler) { - var localGwHandler = this.soulissGwHandler; - localGwHandler = (SoulissGatewayHandler) handler; + SoulissGatewayHandler localGwHandler = (SoulissGatewayHandler) handler; + this.soulissGwHandler = localGwHandler; localGwHandler.discoverResult = this; } } diff --git a/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/handler/SoulissGenericHandler.java b/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/handler/SoulissGenericHandler.java index f6c32d985..5a3e2946e 100644 --- a/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/handler/SoulissGenericHandler.java +++ b/bundles/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/handler/SoulissGenericHandler.java @@ -29,8 +29,6 @@ import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; import org.openhab.core.thing.binding.BaseThingHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * This class implements the base Souliss Typical All other Typicals derive from @@ -52,7 +50,6 @@ public abstract class SoulissGenericHandler extends BaseThingHandler implements private int iSlot; private int iNode; - private final Logger logger = LoggerFactory.getLogger(SoulissGenericHandler.class); private final CommonCommands commonCommands = new CommonCommands();