mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-20 08:51:16 +00:00
Updated UI for configuration and added shutdown of harmony and nest
connections.
This commit is contained in:
@@ -80,6 +80,10 @@ public class HABridge {
|
|||||||
|
|
||||||
bridgeSettings.getBridgeControl().setReinit(false);
|
bridgeSettings.getBridgeControl().setReinit(false);
|
||||||
stop();
|
stop();
|
||||||
|
nestHome.closeTheNest();
|
||||||
|
nestHome = null;
|
||||||
|
harmonyHome.shutdownHarmonyHubs();
|
||||||
|
harmonyHome = null;
|
||||||
}
|
}
|
||||||
log.info("HA Bridge (v" + theVersion.getVersion() + ") exiting....");
|
log.info("HA Bridge (v" + theVersion.getVersion() + ") exiting....");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
|||||||
@@ -97,5 +97,13 @@ public class NestHome {
|
|||||||
public Nest getTheNest() {
|
public Nest getTheNest() {
|
||||||
return theNest;
|
return theNest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void closeTheNest() {
|
||||||
|
theNest.endNestSession();
|
||||||
|
theNest = null;
|
||||||
|
theSession = null;
|
||||||
|
nestItems = null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,4 +119,14 @@ public class HarmonyHandler {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
log.debug("Harmony api shutdown requested.");
|
||||||
|
if(devMode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
harmonyClient.disconnect();
|
||||||
|
harmonyClient = null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
public HarmonyHandler getHarmonyHandler(String aName) {
|
||||||
HarmonyHandler aHandler = null;
|
HarmonyHandler aHandler = null;
|
||||||
if(aName == null || aName.equals("")) {
|
if(aName == null || aName.equals("")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user