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();