mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] force start cloudconnector after credentials are updated (#11459)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
264e19dbfc
commit
ad54da1638
@ -82,7 +82,7 @@ public class MiIoHandlerFactory extends BaseThingHandlerFactory {
|
||||
cloudConnector.setCredentials(username, password, country);
|
||||
try {
|
||||
if (!scheduler.isShutdown()) {
|
||||
scheduledTask = scheduler.submit(() -> cloudConnector.isConnected());
|
||||
scheduledTask = scheduler.submit(() -> cloudConnector.isConnected(true));
|
||||
} else {
|
||||
logger.debug("Unexpected: ScheduledExecutorService is shutdown.");
|
||||
}
|
||||
|
@ -104,10 +104,17 @@ public class CloudConnector {
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return isConnected(false);
|
||||
}
|
||||
|
||||
public boolean isConnected(boolean force) {
|
||||
final MiCloudConnector cl = cloudConnector;
|
||||
if (cl != null && cl.hasLoginToken()) {
|
||||
return true;
|
||||
}
|
||||
if (force) {
|
||||
logonCache.invalidateValue();
|
||||
}
|
||||
final @Nullable Boolean c = logonCache.getValue();
|
||||
if (c != null && c.booleanValue()) {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user