Updating editing for Settings UI.

This commit is contained in:
bwssystems
2016-02-13 17:02:51 -06:00
parent c97ab2cd38
commit 9cb275230e
7 changed files with 86 additions and 38 deletions

View File

@@ -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<NetworkInterface> ifs = NetworkInterface.getNetworkInterfaces();

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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();