config = getConfigAs(InsteonDeviceConfiguration.class);
scheduler.execute(() -> {
- if (getBridge() == null) {
+ final Bridge bridge = getBridge();
+ if (bridge == null) {
String msg = "An Insteon network bridge has not been selected for this device.";
logger.warn("{} {}", thing.getUID().getAsString(), msg);
}
});
- updateStatus(ThingStatus.ONLINE);
+ if (ThingStatus.ONLINE == bridge.getStatus()) {
+ updateStatus(ThingStatus.ONLINE);
+ } else {
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
+ }
} else {
String msg = "Product key '" + productKey
+ "' does not have any features that match existing channels.";