\n"
+ "(null)\n"
@@ -78,7 +79,7 @@ public class UpnpSettingsResource {
log.debug("upnp device settings requested: " + " from " + request.ip() + ":" + request.port());
String portNumber = Integer.toString(request.port());
String filledTemplate = null;
- String bridgeIdMac = HuePublicConfig.createConfig("temp", theSettings.getUpnpConfigAddress()).getSNUUIDFromMac();
+ String bridgeIdMac = HuePublicConfig.createConfig("temp", theSettings.getUpnpConfigAddress(), HueConstants.HUB_VERSION).getSNUUIDFromMac();
filledTemplate = String.format(hueTemplate, theSettings.getUpnpConfigAddress(), portNumber, theSettings.getUpnpConfigAddress(), bridgeIdMac, bridgeIdMac);
if(theSettings.isTraceupnp())
log.info("Traceupnp: upnp device settings template filled with address: " + theSettings.getUpnpConfigAddress() + " and port: " + portNumber);
diff --git a/src/main/java/com/bwssystems/hass/HassCommand.java b/src/main/java/com/bwssystems/hass/HassCommand.java
index c00613b..8638f28 100644
--- a/src/main/java/com/bwssystems/hass/HassCommand.java
+++ b/src/main/java/com/bwssystems/hass/HassCommand.java
@@ -4,7 +4,7 @@ public class HassCommand {
private String entityId;
private String hassName;
private String state;
- private Integer bri;
+ private String bri;
public String getEntityId() {
return entityId;
}
@@ -23,11 +23,10 @@ public class HassCommand {
public void setState(String state) {
this.state = state;
}
- public Integer getBri() {
+ public String getBri() {
return bri;
}
- public void setBri(Integer bri) {
+ public void setBri(String bri) {
this.bri = bri;
- }
-
+ }
}
diff --git a/src/main/java/com/bwssystems/hass/HomeAssistant.java b/src/main/java/com/bwssystems/hass/HomeAssistant.java
index 225d586..f765a89 100644
--- a/src/main/java/com/bwssystems/hass/HomeAssistant.java
+++ b/src/main/java/com/bwssystems/hass/HomeAssistant.java
@@ -73,7 +73,7 @@ public class HomeAssistant {
}
if(aCommand.getState().equalsIgnoreCase("on")) {
aUrl = aUrl + "/turn_on";
- if(aCommand.getBri() != null && aCommand.getBri() > 0)
+ if(aCommand.getBri() != null)
aBody = aBody + ",\"state\":\"on\",\"attributes\":{\"brightness\":" + aCommand.getBri() + "}}";
else
aBody = aBody + "}";
diff --git a/src/main/java/com/bwssystems/hue/HueErrorStringSet.java b/src/main/java/com/bwssystems/hue/HueErrorStringSet.java
deleted file mode 100644
index 9cbaae1..0000000
--- a/src/main/java/com/bwssystems/hue/HueErrorStringSet.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.bwssystems.hue;
-
-public interface HueErrorStringSet {
- public void setErrorString(String anError);
-}
diff --git a/src/main/java/com/bwssystems/hue/HueInfo.java b/src/main/java/com/bwssystems/hue/HueInfo.java
index 7b9a265..61a0258 100644
--- a/src/main/java/com/bwssystems/hue/HueInfo.java
+++ b/src/main/java/com/bwssystems/hue/HueInfo.java
@@ -15,7 +15,7 @@ import com.bwssystems.HABridge.api.hue.HueApiResponse;
import com.google.gson.Gson;
-public class HueInfo implements HueErrorStringSet {
+public class HueInfo {
private static final Logger log = LoggerFactory.getLogger(HueInfo.class);
private HttpClient httpClient;
private NamedIP hueAddress;
@@ -50,7 +50,7 @@ public class HueInfo implements HueErrorStringSet {
log.debug("GET HueApiResponse - data: " + theData);
if(theData.contains("[{\"error\":")) {
if(theData.contains("unauthorized user")) {
- theUser = HueUtil.registerWithHue(httpClient, hueAddress.getIp(), hueAddress.getName(), theHueHome.getTheHUERegisteredUser(), this);
+ theUser = HueUtil.registerWithHue(httpClient, hueAddress.getIp(), hueAddress.getName(), theHueHome.getTheHUERegisteredUser());
if(theUser == null) {
log.warn("Register to Hue for " + hueAddress.getName() + " returned error: " + errorString);
return null;
@@ -103,9 +103,4 @@ public class HueInfo implements HueErrorStringSet {
public void setHueAddress(NamedIP hueAddress) {
this.hueAddress = hueAddress;
}
-
- @Override
- public void setErrorString(String anError) {
- errorString = anError;
- }
}
diff --git a/src/main/java/com/bwssystems/hue/HueUtil.java b/src/main/java/com/bwssystems/hue/HueUtil.java
index d2806f0..8a4baaa 100644
--- a/src/main/java/com/bwssystems/hue/HueUtil.java
+++ b/src/main/java/com/bwssystems/hue/HueUtil.java
@@ -19,7 +19,7 @@ public class HueUtil {
private static final Logger log = LoggerFactory.getLogger(HueUtil.class);
public static final String HUE_REQUEST = "/api";
- public static final String registerWithHue(HttpClient anHttpClient, String ipAddress, String aName, String theUser, HueErrorStringSet errorStringSet) {
+ public static final String registerWithHue(HttpClient anHttpClient, String ipAddress, String aName, String theUser) {
UserCreateRequest theLogin = new UserCreateRequest();
theLogin.setDevicetype("HABridge#MyMachine");
HttpPost postRequest = new HttpPost("http://" + ipAddress + HUE_REQUEST);
@@ -39,7 +39,6 @@ public class HueUtil {
}
else
log.warn("registerWithHue returned an unexpected error: " + theBody);
- errorStringSet.setErrorString(theBody);
}
else {
SuccessUserResponse[] theResponses = new Gson().fromJson(theBody, SuccessUserResponse[].class); //read content for data, SuccessUserResponse[].class);
diff --git a/src/main/resources/public/views/configuration.html b/src/main/resources/public/views/configuration.html
index a6dfb19..a0e9ca4 100644
--- a/src/main/resources/public/views/configuration.html
+++ b/src/main/resources/public/views/configuration.html
@@ -41,7 +41,6 @@
| Name |
Type |
Target |
- Requester Address |
Actions |
@@ -51,7 +50,6 @@
{{device.name}} |
{{device.deviceType}} |
{{device.targetDevice}} |
- {{device.requesterAddress}} |
|
+
+ | Emulate Hue Hub Version |
+ |
+
| Button Press/Call Item Loop Sleep Interval (ms) |
|