Updated the register with hue function to not send a user name when

linking as this has been deprecated by Philips.

Fixes #99
This commit is contained in:
Admin
2016-04-29 16:12:52 -05:00
parent 3bf52f5da0
commit 7e0fd6c21b
2 changed files with 2 additions and 6 deletions

View File

@@ -5,7 +5,7 @@
<groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
<packaging>jar</packaging>
<name>HA Bridge</name>

View File

@@ -21,11 +21,7 @@ public class HueUtil {
public static final String registerWithHue(HttpClient anHttpClient, String ipAddress, String aName, String theUser, HueErrorStringSet errorStringSet) {
UserCreateRequest theLogin = new UserCreateRequest();
theLogin.setDevicetype("HA Bridge");
if(theUser == null)
theLogin.setUsername("habridge");
else
theLogin.setUsername(theUser);
theLogin.setDevicetype("HABridge#MyMachine");
HttpPost postRequest = new HttpPost("http://" + ipAddress + HUE_REQUEST);
ContentType parsedContentType = ContentType.parse("application/json");
StringEntity requestBody = new StringEntity(new Gson().toJson(theLogin), parsedContentType);