Updated UI for configuration and added shutdown of harmony and nest

connections.
This commit is contained in:
Admin
2016-02-16 16:52:12 -06:00
parent 9cb275230e
commit 1d6a4c1432
4 changed files with 30 additions and 0 deletions

View File

@@ -80,6 +80,10 @@ public class HABridge {
bridgeSettings.getBridgeControl().setReinit(false);
stop();
nestHome.closeTheNest();
nestHome = null;
harmonyHome.shutdownHarmonyHubs();
harmonyHome = null;
}
log.info("HA Bridge (v" + theVersion.getVersion() + ") exiting....");
System.exit(0);

View File

@@ -97,5 +97,13 @@ public class NestHome {
public Nest getTheNest() {
return theNest;
}
public void closeTheNest() {
theNest.endNestSession();
theNest = null;
theSession = null;
nestItems = null;
}
}

View File

@@ -119,4 +119,14 @@ public class HarmonyHandler {
return true;
}
public void shutdown() {
log.debug("Harmony api shutdown requested.");
if(devMode)
return;
harmonyClient.disconnect();
harmonyClient = null;
}
}

View File

@@ -48,6 +48,14 @@ public class HarmonyHome {
}
}
public void shutdownHarmonyHubs() {
Iterator<String> keys = hubs.keySet().iterator();
while(keys.hasNext()) {
String key = keys.next();
hubs.get(key).getMyHarmony().shutdown();
}
}
public HarmonyHandler getHarmonyHandler(String aName) {
HarmonyHandler aHandler = null;
if(aName == null || aName.equals("")) {