mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplyfy status logic check
Signed-off-by: clinique <gael@lhopital.org>
This commit is contained in:
parent
eded3ca791
commit
e868d3264a
@ -86,17 +86,14 @@ public class RefreshCapability extends Capability {
|
|||||||
private void proceedWithUpdate() {
|
private void proceedWithUpdate() {
|
||||||
Duration delay;
|
Duration delay;
|
||||||
handler.proceedWithUpdate();
|
handler.proceedWithUpdate();
|
||||||
if (!ThingStatus.ONLINE.equals(handler.getThing().getStatus())) {
|
if (handler.getAccountHandler() instanceof ApiBridgeHandler accountHandler
|
||||||
if (handler.getAccountHandler() instanceof ApiBridgeHandler accountHandler
|
&& !ThingStatus.ONLINE.equals(accountHandler.getThing().getStatus())) {
|
||||||
&& !ThingStatus.ONLINE.equals(accountHandler.getThing().getStatus())) {
|
delay = accountHandler.getTimeBeforeReconnect();
|
||||||
delay = accountHandler.getTimeBeforeReconnect();
|
delay = delay != null ? delay.plus(ASAP) : OFFLINE_DELAY;
|
||||||
delay = delay != null ? delay.plus(ASAP) : OFFLINE_DELAY;
|
logger.debug("Bridge is not ONLINE, will wait for him to come-back {}", delay);
|
||||||
logger.debug("Bridge is not ONLINE, will wait for him to come-back {}", delay);
|
} else if (!ThingStatus.ONLINE.equals(handler.getThing().getStatus())) {
|
||||||
} else {
|
delay = OFFLINE_DELAY;
|
||||||
delay = OFFLINE_DELAY;
|
logger.debug("Thing '{}' is not ONLINE, special refresh interval {} used", thingUID, delay);
|
||||||
logger.debug("Thing '{}' is not ONLINE, special refresh interval {} used", thingUID, delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
delay = calcDelay();
|
delay = calcDelay();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user