use of org.eclipse.smarthome.core.thing.binding.builder.ThingStatusInfoBuilder in project smarthome by eclipse.
the class ThingManager method buildStatusInfo.
private ThingStatusInfo buildStatusInfo(ThingStatus thingStatus, ThingStatusDetail thingStatusDetail, String description) {
ThingStatusInfoBuilder statusInfoBuilder = ThingStatusInfoBuilder.create(thingStatus, thingStatusDetail);
statusInfoBuilder.withDescription(description);
return statusInfoBuilder.build();
}
use of org.eclipse.smarthome.core.thing.binding.builder.ThingStatusInfoBuilder in project smarthome by eclipse.
the class FSInternetRadioHandlerJavaTest method verifyConfigurationError.
private void verifyConfigurationError() {
ThingStatusInfoBuilder statusBuilder = ThingStatusInfoBuilder.create(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR);
ThingStatusInfo statusInfo = statusBuilder.withDescription("Configuration incomplete").build();
verify(callback, atLeast(1)).statusUpdated(radioThing, statusInfo);
}
use of org.eclipse.smarthome.core.thing.binding.builder.ThingStatusInfoBuilder in project smarthome by eclipse.
the class BaseThingHandler method updateStatus.
/**
* Updates the status of the thing.
*
* @param status the status
* @param statusDetail the detail of the status
* @param description the description of the status
* @throws IllegalStateException if handler is not initialized correctly, because no callback is present
*/
protected void updateStatus(ThingStatus status, ThingStatusDetail statusDetail, @Nullable String description) {
synchronized (this) {
if (this.callback != null) {
ThingStatusInfoBuilder statusBuilder = ThingStatusInfoBuilder.create(status, statusDetail);
ThingStatusInfo statusInfo = statusBuilder.withDescription(description).build();
this.callback.statusUpdated(this.thing, statusInfo);
} else {
throw new IllegalStateException("Could not update status, because callback is missing");
}
}
}
use of org.eclipse.smarthome.core.thing.binding.builder.ThingStatusInfoBuilder in project smarthome by eclipse.
the class FSInternetRadioHandlerJavaTest method verifyOnlineStatusIsSet.
private void verifyOnlineStatusIsSet() {
ThingStatusInfoBuilder statusBuilder = ThingStatusInfoBuilder.create(ThingStatus.ONLINE, ThingStatusDetail.NONE);
ThingStatusInfo statusInfo = statusBuilder.withDescription(null).build();
verify(callback, atLeast(1)).statusUpdated(radioThing, statusInfo);
}
Aggregations