From a7ab2afbb3f0b4485cfbcea4422f022b10f79e3a Mon Sep 17 00:00:00 2001 From: M Valla <12682715+mvalla@users.noreply.github.com> Date: Sun, 16 Jul 2023 14:48:13 +0200 Subject: [PATCH] [openwebnet] Backward support for CU configurations with where="0" (#15248) Signed-off-by: Massimo Valla --- .../handler/OpenWebNetThermoregulationHandler.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 cccc420ec..7ef93cba9 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 @@ -267,7 +267,11 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler { private String getWhere(String where) { if (isCentralUnit) { - return where; + if (where.charAt(0) == '#') { + return where; + } else { // to support old configurations for CU with where="0" + return "#" + where; + } } else { return isStandAlone ? where : "#" + where; } @@ -580,10 +584,8 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler { String w = deviceWhere.value(); 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 try { - send(Thermoregulation.requestStatus(w)); + send(Thermoregulation.requestStatus(getWhere(w))); } catch (OWNException e) { logger.warn("refreshDevice() central unit returned OWNException {}", e.getMessage()); }