diff --git a/pom.xml b/pom.xml index 2c0cab8..a12ab46 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 1.3.8d + 1.3.8e jar HA Bridge diff --git a/src/main/java/com/bwssystems/HABridge/BridgeSettings.java b/src/main/java/com/bwssystems/HABridge/BridgeSettings.java index b31742f..760406e 100644 --- a/src/main/java/com/bwssystems/HABridge/BridgeSettings.java +++ b/src/main/java/com/bwssystems/HABridge/BridgeSettings.java @@ -100,7 +100,7 @@ public class BridgeSettings extends BackupHandler { theBridgeSettings.setNestpwd(System.getProperty("nest.pwd")); } - if(theBridgeSettings.getUpnpConfigAddress() == null) { + if(theBridgeSettings.getUpnpConfigAddress() == null || theBridgeSettings.getUpnpConfigAddress().equals("")) { try { log.info("Getting an IP address for this host...."); Enumeration ifs = NetworkInterface.getNetworkInterfaces(); diff --git a/src/main/java/com/bwssystems/HABridge/BridgeSettingsDescriptor.java b/src/main/java/com/bwssystems/HABridge/BridgeSettingsDescriptor.java index 5ab2cb7..baa4713 100644 --- a/src/main/java/com/bwssystems/HABridge/BridgeSettingsDescriptor.java +++ b/src/main/java/com/bwssystems/HABridge/BridgeSettingsDescriptor.java @@ -4,8 +4,8 @@ import java.util.List; public class BridgeSettingsDescriptor { private String upnpconfigaddress; - private String serverport; - private String upnpresponseport; + private Integer serverport; + private Integer upnpresponseport; private String upnpdevicedb; private IpList veraaddress; private IpList harmonyaddress; @@ -37,18 +37,24 @@ public class BridgeSettingsDescriptor { public void setUpnpConfigAddress(String upnpConfigAddress) { this.upnpconfigaddress = upnpConfigAddress; } - public String getServerPort() { + public Integer getServerPort() { return serverport; } - public void setServerPort(String serverPort) { + public void setServerPort(Integer serverPort) { this.serverport = serverPort; } - public String getUpnpResponsePort() { + public void setServerPort(String serverPort) { + this.serverport = Integer.valueOf(serverPort); + } + public Integer getUpnpResponsePort() { return upnpresponseport; } - public void setUpnpResponsePort(String upnpResponsePort) { + public void setUpnpResponsePort(Integer upnpResponsePort) { this.upnpresponseport = upnpResponsePort; } + public void setUpnpResponsePort(String upnpResponsePort) { + this.upnpresponseport = Integer.valueOf(upnpResponsePort); + } public String getUpnpDeviceDb() { return upnpdevicedb; } diff --git a/src/main/java/com/bwssystems/HABridge/HABridge.java b/src/main/java/com/bwssystems/HABridge/HABridge.java index c5cc047..a61f8b7 100644 --- a/src/main/java/com/bwssystems/HABridge/HABridge.java +++ b/src/main/java/com/bwssystems/HABridge/HABridge.java @@ -52,7 +52,7 @@ public class HABridge { // sparkjava config directive to set ip address for the web server to listen on // ipAddress("0.0.0.0"); // not used // sparkjava config directive to set port for the web server to listen on - port(Integer.valueOf(bridgeSettings.getBridgeSettingsDescriptor().getServerPort())); + port(bridgeSettings.getBridgeSettingsDescriptor().getServerPort()); // sparkjava config directive to set html static file location for Jetty staticFileLocation("/public"); // setup system control api first diff --git a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java index de15ae0..fb4a8a3 100644 --- a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java +++ b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java @@ -25,7 +25,7 @@ public class UpnpListener { public UpnpListener(BridgeSettingsDescriptor theSettings, BridgeControlDescriptor theControl) { super(); - upnpResponsePort = Integer.valueOf(theSettings.getUpnpResponsePort()); + upnpResponsePort = theSettings.getUpnpResponsePort(); httpServerPort = Integer.valueOf(theSettings.getServerPort()); responseAddress = theSettings.getUpnpConfigAddress(); strict = theSettings.isUpnpStrict(); diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index 45b4d4f..8ed226f 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -517,6 +517,13 @@ app.controller('SystemController', function ($scope, $location, $http, $window, $scope.imgUrl = "glyphicon glyphicon-plus"; $scope.visibleBk = false; $scope.imgBkUrl = "glyphicon glyphicon-plus"; + $scope.addVeratoSettings = function (newveraname, newveraip) { + if($scope.bridge.settings.veraddress == null) { + $scope.bridge.settings.veraddress = { devices: [] }; + } + + $scope.bridge.settings.veraaddress.devices.push("{" +"\"name\":\"" + newveraname +"\",\"ip\":\"" + newveraip + "\"}"); + }; $scope.saveSettings = function() { bridgeService.saveSettings(); }; diff --git a/src/main/resources/public/views/system.html b/src/main/resources/public/views/system.html index b9f523e..6011227 100644 --- a/src/main/resources/public/views/system.html +++ b/src/main/resources/public/views/system.html @@ -52,88 +52,123 @@ - config.file - {{bridge.settings.configfile}} + Configuration Path and File + - upnp.devices.db - {{bridge.settings.upnpdevicedb}} + Device DB Path and File + - upnp.config.address - {{bridge.settings.upnpconfigaddress}} + UPNP IP Address + - server.port - {{bridge.settings.serverport}} + Web Server Port + - upnp.response.port - {{bridge.settings.upnpresponseport}} + UPNP Response Port + - vera.address + Vera Names and IP Addresses + + + + + + +
Name IPManage
{{vera.name}} {{vera.ip}}
- harmony.address + Harmony Names and IP Addresses + + + + + + +
Name IPManage
{{harmony.name}} {{harmony.ip}}
- harmony.user - {{bridge.settings.harmonyuser}} + Harmony Username + - harmony.pwd - {{bridge.settings.harmonypwd}} + Harmony Password + - button.sleep - {{bridge.settings.buttonsleep}} ms + Button Press Sleep Interval (ms) + - nest.user - {{bridge.settings.nestuser}} + Nest Username + - nest.pwd - {{bridge.settings.nestpwd}} + Nest Password + - upnp.strict - {{bridge.settings.upnpstrict}} + UPNP Strict Handling + {{bridge.settings.upnpstrict}} - trace.upnp - {{bridge.settings.traceupnp}} + Trace UPNP Calls + {{bridge.settings.traceupnp}} - dev.mode - {{bridge.settings.devmode}} + Harmony Development Mode + {{bridge.settings.devmode}}