.map(Boolean::parseBoolean);
}
- public Optional<String> 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<Boolean> getCoolingAllowed() {
return this.actuatorFunctionalities.getCoolingAllowed();
}
- public Optional<String> getRegulationControl() {
- return this.actuatorFunctionalities.getRegulationControl();
+ public String getRegulationControl() {
+ if (this.actuatorFunctionalities != null) {
+ return this.actuatorFunctionalities.getRegulationControl();
+ }
+ return null;
}
public int applianceCount() {
} 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());
}
}
}
break;
case ZONE_REGULATION_CHANNEL:
- state = new StringType(entity.getRegulationControl().orElse(null));
+ String value = entity.getRegulationControl();
+ if (value != null) {
+ state = new StringType(entity.getRegulationControl());
+ }
break;
case ZONE_TEMPERATURE_CHANNEL:
if (entity.getTemperature().isPresent()) {