From 4e4385e2610fb8ef9b26e62da3339b3b25d19027 Mon Sep 17 00:00:00 2001 From: M Valla <12682715+mvalla@users.noreply.github.com> Date: Sun, 19 Mar 2023 09:43:53 +0100 Subject: [PATCH] [openwebnet] Thermo: Fix wrong parameter in .getChannel (#14620) Fixes #14619 Signed-off-by: Massimo Valla --- .../OpenWebNetThermoregulationHandler.java | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java index 9d9bee632..a7b9a87b4 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java @@ -12,23 +12,7 @@ */ 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) {