* Fix bug introduced with #12349 Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
0737ee6bef
commit
da0234f69c
|
@ -35,8 +35,12 @@ public class ActuatorFunctionalities extends PlugwiseHACollection<ActuatorFuncti
|
|||
.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() {
|
||||
|
|
|
@ -81,8 +81,8 @@ public class ActuatorFunctionality extends PlugwiseBaseModel implements Plugwise
|
|||
return updatedDate;
|
||||
}
|
||||
|
||||
public Optional<String> getRegulationControl() {
|
||||
return Optional.ofNullable(regulationControl);
|
||||
public String getRegulationControl() {
|
||||
return regulationControl;
|
||||
}
|
||||
|
||||
public Optional<String> getCoolingAllowed() {
|
||||
|
|
|
@ -109,8 +109,11 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat
|
|||
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() {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,7 +224,10 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
|
|||
}
|
||||
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()) {
|
||||
|
|
Loading…
Reference in New Issue