Fix recent regression when bridge is offline while initializing child things. (#12259)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2022-02-10 23:34:14 +01:00 committed by GitHub
parent 888cf00245
commit 1be50736e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -79,7 +79,12 @@ public class HDPowerViewRepeaterHandler extends AbstractHubbedThingHandler {
"@text/offline.conf-error.invalid-bridge-handler");
return;
}
updateStatus(ThingStatus.UNKNOWN);
ThingStatus bridgeStatus = bridge.getStatus();
if (bridgeStatus == ThingStatus.ONLINE) {
updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
}
scheduleRefreshJob();
}

View File

@ -109,7 +109,12 @@ public class HDPowerViewShadeHandler extends AbstractHubbedThingHandler {
"@text/offline.conf-error.invalid-bridge-handler");
return;
}
updateStatus(ThingStatus.UNKNOWN);
ThingStatus bridgeStatus = bridge.getStatus();
if (bridgeStatus == ThingStatus.ONLINE) {
updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
}
}
@Override