diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalities.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalities.java index 4d4ec3081..623954de8 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalities.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalities.java @@ -35,8 +35,12 @@ public class ActuatorFunctionalities extends PlugwiseHACollection getRegulationControl() { - return this.getFunctionalityThermostat().flatMap(ActuatorFunctionality::getRegulationControl); + public String getRegulationControl() { + ActuatorFunctionality functionality = this.getFunctionalityThermostat().orElse(null); + if (functionality != null) { + return functionality.getRegulationControl(); + } + return null; } public Optional getCoolingAllowed() { diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionality.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionality.java index d42ff7dde..e25288ccd 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionality.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionality.java @@ -81,8 +81,8 @@ public class ActuatorFunctionality extends PlugwiseBaseModel implements Plugwise return updatedDate; } - public Optional getRegulationControl() { - return Optional.ofNullable(regulationControl); + public String getRegulationControl() { + return regulationControl; } public Optional getCoolingAllowed() { diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java index 521849dc4..6e6673e1f 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java @@ -109,8 +109,11 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat return this.actuatorFunctionalities.getCoolingAllowed(); } - public Optional getRegulationControl() { - return this.actuatorFunctionalities.getRegulationControl(); + public String getRegulationControl() { + if (this.actuatorFunctionalities != null) { + return this.actuatorFunctionalities.getRegulationControl(); + } + return null; } public int applianceCount() { diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHABridgeHandler.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHABridgeHandler.java index 0be22adcc..b657b149d 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHABridgeHandler.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHABridgeHandler.java @@ -175,12 +175,16 @@ public class PlugwiseHABridgeHandler extends BaseBridgeHandler { } catch (PlugwiseHAUnauthorizedException | PlugwiseHANotAuthorizedException e) { updateStatus(OFFLINE, CONFIGURATION_ERROR, STATUS_DESCRIPTION_INVALID_CREDENTIALS); } catch (PlugwiseHACommunicationException e) { + this.logger.trace("Bridge encountered an error {}", e.getMessage(), e); updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_COMMUNICATION_ERROR); } catch (PlugwiseHATimeoutException e) { + this.logger.trace("Bridge encountered an error {}", e.getMessage(), e); updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_TIMEOUT); } catch (PlugwiseHAException e) { + this.logger.trace("Bridge encountered an error {}", e.getMessage(), e); updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage()); } catch (RuntimeException e) { + this.logger.trace("Bridge encountered an error {}", e.getMessage(), e); updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage()); } } diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAZoneHandler.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAZoneHandler.java index 658cf0167..593bce38a 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAZoneHandler.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAZoneHandler.java @@ -224,7 +224,10 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler