use of org.openhab.core.thing.ThingStatusInfo in project openhab-addons by openhab.
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.openhab.core.thing.ThingStatusInfo in project openhab-addons by openhab.
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);
}
use of org.openhab.core.thing.ThingStatusInfo in project openhab-addons by openhab.
the class HDPowerViewHubHandler method updateUnknownShadeThing.
private void updateUnknownShadeThing(Thing thing) {
String shadeId = thing.getUID().getId();
logger.debug("Shade '{}' has no data in hub", shadeId);
HDPowerViewShadeHandler thingHandler = ((HDPowerViewShadeHandler) thing.getHandler());
if (thingHandler == null) {
logger.debug("Shade '{}' handler not initialized", shadeId);
pendingShadeInitializations.put(thing.getUID(), new ShadeData());
return;
}
ThingStatus thingStatus = thingHandler.getThing().getStatus();
switch(thingStatus) {
case UNKNOWN:
case ONLINE:
case OFFLINE:
thing.setStatusInfo(new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.GONE, "@text/offline.gone.shade-unknown-to-hub"));
break;
case UNINITIALIZED:
case INITIALIZING:
logger.debug("Shade '{}' handler not yet ready; status: {}", shadeId, thingStatus);
pendingShadeInitializations.put(thing.getUID(), new ShadeData());
break;
case REMOVING:
case REMOVED:
default:
logger.debug("Ignoring shade status update for shade '{}' in status {}", shadeId, thingStatus);
break;
}
}
use of org.openhab.core.thing.ThingStatusInfo in project openhab-addons by openhab.
the class HyperionNgHandler method updateOnlineStatus.
private void updateOnlineStatus(ThingStatus status, ThingStatusDetail detail, String message) {
ThingStatusInfo currentStatusInfo = thing.getStatusInfo();
ThingStatus currentStatus = currentStatusInfo.getStatus();
ThingStatusDetail currentDetail = currentStatusInfo.getStatusDetail();
if (!currentStatus.equals(status) || !currentDetail.equals(detail)) {
updateStatus(status, detail, message);
}
}
use of org.openhab.core.thing.ThingStatusInfo in project openhab-addons by openhab.
the class CircuitHandler method onDeviceAdded.
@Override
public void onDeviceAdded(GeneralDeviceInformation device) {
if (device instanceof Circuit) {
this.circuit = (Circuit) device;
if (this.circuit.isPresent()) {
ThingStatusInfo statusInfo = this.dssBridgeHandler.getThing().getStatusInfo();
updateStatus(statusInfo.getStatus(), statusInfo.getStatusDetail(), statusInfo.getDescription());
logger.debug("Set status to {}", getThing().getStatus());
checkCircuitInfoProperties(this.circuit);
// load first channel values
onCircuitStateInitial(this.circuit);
return;
}
}
onDeviceRemoved(device);
}
Aggregations