[insteon] set device to offline if network is not online after initialization (#12790)
* [insteon] set device to offline if network is not online during initialization Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
This commit is contained in:
parent
7f249872bc
commit
88e7ba3774
|
@ -136,7 +136,8 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||||
config = getConfigAs(InsteonDeviceConfiguration.class);
|
config = getConfigAs(InsteonDeviceConfiguration.class);
|
||||||
|
|
||||||
scheduler.execute(() -> {
|
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.";
|
String msg = "An Insteon network bridge has not been selected for this device.";
|
||||||
logger.warn("{} {}", thing.getUID().getAsString(), msg);
|
logger.warn("{} {}", thing.getUID().getAsString(), msg);
|
||||||
|
|
||||||
|
@ -371,7 +372,11 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
updateStatus(ThingStatus.ONLINE);
|
if (ThingStatus.ONLINE == bridge.getStatus()) {
|
||||||
|
updateStatus(ThingStatus.ONLINE);
|
||||||
|
} else {
|
||||||
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String msg = "Product key '" + productKey
|
String msg = "Product key '" + productKey
|
||||||
+ "' does not have any features that match existing channels.";
|
+ "' does not have any features that match existing channels.";
|
||||||
|
|
Loading…
Reference in New Issue