]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openwebnet] Thermo: Fix wrong parameter in .getChannel (#14620)
authorM Valla <12682715+mvalla@users.noreply.github.com>
Sun, 19 Mar 2023 08:43:53 +0000 (09:43 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Mar 2023 08:43:53 +0000 (09:43 +0100)
Fixes #14619

Signed-off-by: Massimo Valla <mvcode00@gmail.com>
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java

index 9d9bee6321bfe2c787defeb1ae029ef227913084..a7b9a87b4b495ac05b207872f32eb664e27346c2 100644 (file)
  */
 package org.openhab.binding.openwebnet.internal.handler;
 
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_ACTUATORS;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CONDITIONING_VALVES;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_MANUAL;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_OFF;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_PROTECTION;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_BATTERY_STATUS;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_FAILURE_DISCOVERED;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_REMOTE_CONTROL;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_SCENARIO_PROGRAM_NUMBER;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_WEEKLY_PROGRAM_NUMBER;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_FAN_SPEED;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_FUNCTION;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_HEATING_VALVES;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_LOCAL_OFFSET;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_MODE;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_TEMPERATURE;
-import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_TEMP_SETPOINT;
+import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.*;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -60,7 +44,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for Thermoregulation
+ * The {@link OpenWebNetThermoregulationHandler} is responsible for handling
+ * commands/messages for Thermoregulation
  * Things. It extends the abstract {@link OpenWebNetThingHandler}.
  *
  * @author Massimo Valla - Initial contribution
@@ -122,7 +107,8 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
                         "@text/offline.conf-error-where");
             }
 
-            // reset state of signal channels (they will be setted when specific messages are received)
+            // reset state of signal channels (they will be setted when specific messages
+            // are received)
             updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_MANUAL, OnOffType.OFF);
             updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_OFF, OnOffType.OFF);
             updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_PROTECTION, OnOffType.OFF);
@@ -580,15 +566,15 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
     }
 
     private Boolean channelExists(String channelID) {
-        return thing.getChannel("openwebnet:" + channelID) != null;
+        return thing.getChannel(channelID) != null;
     }
 
     @Override
     protected void refreshDevice(boolean refreshAll) {
         logger.debug("--- refreshDevice() : refreshing SINGLE... ({})", thing.getUID());
         if (isCentralUnit) {
-            // TODO: 4 zone central -> zone #0 CAN be also a zone with its temp.. with 99-zones central no!
-            // let's assume it's a 99 zone
+            // TODO: 4 zone central -> zone #0 CAN be also a zone with its temp.. with
+            // 99-zones central no! let's assume it's a 99 zone
             try {
                 send(Thermoregulation.requestStatus("#0"));
             } catch (OWNException e) {