Updating HAL changes

This commit is contained in:
Admin
2017-05-31 16:32:33 -05:00
parent d78c7c536d
commit 998450af4e
5 changed files with 45 additions and 75 deletions

View File

@@ -385,8 +385,10 @@ public class BridgeSettingsDescriptor {
List<NamedIP> devicesList = this.getHaladdress().getDevices();
if(devicesList.get(0).getIp().contains(Configuration.DEFAULT_ADDRESS))
return false;
if(this.getHaltoken() == null || this.getHaltoken().equals(""))
return false;
if(devicesList.get(0).getPassword() == null || devicesList.get(0).getPassword().trim().isEmpty()) {
if(this.getHaltoken() == null || this.getHaltoken().equals(""))
return false;
}
return true;
}
public Boolean isValidMQTT() {

View File

@@ -129,10 +129,9 @@ public class HalHome implements Home {
+ (anItem.getHttpVerb() == null ? "GET" : anItem.getHttpVerb()) + ": "
+ anItem.getItem().getAsString());
String anUrl = intermediate;
String anUrl = null;
anUrl = BrightnessDecode.calculateReplaceIntensityValue(anUrl,
intensity, targetBri, targetBriInc, false);
anUrl = BrightnessDecode.calculateReplaceIntensityValue(intermediate, intensity, targetBri, targetBriInc, false);
anUrl = DeviceDataDecode.replaceDeviceData(anUrl, device);
anUrl = TimeDecode.replaceTimeValue(anUrl);
@@ -143,6 +142,10 @@ public class HalHome implements Home {
anUrl = "https://" + anUrl;
else
anUrl = "http://" + anUrl;
if(!anUrl.contains("?Token="))
anUrl = anUrl + "?Token=" + entry.getValue().getHalAddress().getPassword();
if (entry.getValue().deviceCommand(anUrl) == null) {
log.warn("Error on calling hal to change device state: " + anUrl);
responseString = new Gson().toJson(HueErrorResponse.createResponse("6", "/lights/" + lightId,

View File

@@ -125,7 +125,10 @@ public class HalInfo {
HalDevice aNewHalDevice = new HalDevice();
aNewHalDevice.setHaldevicetype(deviceType);
aNewHalDevice.setHaldevicename(theDevice.getDeviceName());
aNewHalDevice.setHaladdress(halAddress);
NamedIP theaddress = new NamedIP();
theaddress.setIp(halAddress.getIp());
theaddress.setName(halAddress.getName());
aNewHalDevice.setHaladdress(theaddress);
deviceList.add(aNewHalDevice);
}