* 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);
|
.map(Boolean::parseBoolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<String> getRegulationControl() {
|
public String getRegulationControl() {
|
||||||
return this.getFunctionalityThermostat().flatMap(ActuatorFunctionality::getRegulationControl);
|
ActuatorFunctionality functionality = this.getFunctionalityThermostat().orElse(null);
|
||||||
|
if (functionality != null) {
|
||||||
|
return functionality.getRegulationControl();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Boolean> getCoolingAllowed() {
|
public Optional<Boolean> getCoolingAllowed() {
|
||||||
|
|
|
@ -81,8 +81,8 @@ public class ActuatorFunctionality extends PlugwiseBaseModel implements Plugwise
|
||||||
return updatedDate;
|
return updatedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<String> getRegulationControl() {
|
public String getRegulationControl() {
|
||||||
return Optional.ofNullable(regulationControl);
|
return regulationControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<String> getCoolingAllowed() {
|
public Optional<String> getCoolingAllowed() {
|
||||||
|
|
|
@ -109,8 +109,11 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat
|
||||||
return this.actuatorFunctionalities.getCoolingAllowed();
|
return this.actuatorFunctionalities.getCoolingAllowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<String> getRegulationControl() {
|
public String getRegulationControl() {
|
||||||
return this.actuatorFunctionalities.getRegulationControl();
|
if (this.actuatorFunctionalities != null) {
|
||||||
|
return this.actuatorFunctionalities.getRegulationControl();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int applianceCount() {
|
public int applianceCount() {
|
||||||
|
|
|
@ -175,12 +175,16 @@ public class PlugwiseHABridgeHandler extends BaseBridgeHandler {
|
||||||
} catch (PlugwiseHAUnauthorizedException | PlugwiseHANotAuthorizedException e) {
|
} catch (PlugwiseHAUnauthorizedException | PlugwiseHANotAuthorizedException e) {
|
||||||
updateStatus(OFFLINE, CONFIGURATION_ERROR, STATUS_DESCRIPTION_INVALID_CREDENTIALS);
|
updateStatus(OFFLINE, CONFIGURATION_ERROR, STATUS_DESCRIPTION_INVALID_CREDENTIALS);
|
||||||
} catch (PlugwiseHACommunicationException e) {
|
} catch (PlugwiseHACommunicationException e) {
|
||||||
|
this.logger.trace("Bridge encountered an error {}", e.getMessage(), e);
|
||||||
updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_COMMUNICATION_ERROR);
|
updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_COMMUNICATION_ERROR);
|
||||||
} catch (PlugwiseHATimeoutException e) {
|
} catch (PlugwiseHATimeoutException e) {
|
||||||
|
this.logger.trace("Bridge encountered an error {}", e.getMessage(), e);
|
||||||
updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_TIMEOUT);
|
updateStatus(OFFLINE, COMMUNICATION_ERROR, STATUS_DESCRIPTION_TIMEOUT);
|
||||||
} catch (PlugwiseHAException e) {
|
} catch (PlugwiseHAException e) {
|
||||||
|
this.logger.trace("Bridge encountered an error {}", e.getMessage(), e);
|
||||||
updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage());
|
updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage());
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
this.logger.trace("Bridge encountered an error {}", e.getMessage(), e);
|
||||||
updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage());
|
updateStatus(OFFLINE, COMMUNICATION_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,10 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ZONE_REGULATION_CHANNEL:
|
case ZONE_REGULATION_CHANNEL:
|
||||||
state = new StringType(entity.getRegulationControl().orElse(null));
|
String value = entity.getRegulationControl();
|
||||||
|
if (value != null) {
|
||||||
|
state = new StringType(entity.getRegulationControl());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ZONE_TEMPERATURE_CHANNEL:
|
case ZONE_TEMPERATURE_CHANNEL:
|
||||||
if (entity.getTemperature().isPresent()) {
|
if (entity.getTemperature().isPresent()) {
|
||||||
|
|
Loading…
Reference in New Issue