mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-16 18:24:36 +00:00
Updateing HAL handling
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package com.bwssystems.HABridge.plugins.hal;
|
||||
|
||||
import com.bwssystems.HABridge.NamedIP;
|
||||
|
||||
public class HalDevice {
|
||||
private String haldevicetype;
|
||||
private String haldevicename;
|
||||
private String haladdress;
|
||||
private String halname;
|
||||
private Boolean secure;
|
||||
private NamedIP haladdress;
|
||||
private DeviceElements buttons;
|
||||
public String getHaldevicetype() {
|
||||
return haldevicetype;
|
||||
@@ -19,24 +19,12 @@ public class HalDevice {
|
||||
public void setHaldevicename(String haldevicename) {
|
||||
this.haldevicename = haldevicename;
|
||||
}
|
||||
public String getHaladdress() {
|
||||
public NamedIP getHaladdress() {
|
||||
return haladdress;
|
||||
}
|
||||
public void setHaladdress(String haladdress) {
|
||||
public void setHaladdress(NamedIP haladdress) {
|
||||
this.haladdress = haladdress;
|
||||
}
|
||||
public String getHalname() {
|
||||
return halname;
|
||||
}
|
||||
public void setHalname(String halname) {
|
||||
this.halname = halname;
|
||||
}
|
||||
public Boolean getSecure() {
|
||||
return secure;
|
||||
}
|
||||
public void setSecure(Boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
public DeviceElements getButtons() {
|
||||
return buttons;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ public class HalInfo {
|
||||
private static final String IRDATA_TYPE = "IrData";
|
||||
private HTTPHandler httpClient;
|
||||
private NamedIP halAddress;
|
||||
private String theToken;
|
||||
|
||||
public HalInfo(NamedIP addressName, String aGivenToken) {
|
||||
super();
|
||||
httpClient = new HTTPHandler();
|
||||
halAddress = addressName;
|
||||
theToken = aGivenToken;
|
||||
if(halAddress.getPassword() == null || halAddress.getPassword().trim().isEmpty())
|
||||
halAddress.setPassword(aGivenToken);
|
||||
}
|
||||
|
||||
public List<HalDevice> getLights() {
|
||||
@@ -102,12 +102,12 @@ public class HalInfo {
|
||||
theUrl = "https://";
|
||||
else
|
||||
theUrl = "http://";
|
||||
theUrl = theUrl + halAddress.getIp() + apiType + theToken;
|
||||
theUrl = theUrl + halAddress.getIp() + apiType + halAddress.getPassword();
|
||||
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
||||
if(theData != null) {
|
||||
log.debug("GET " + deviceType + " HalApiResponse - data: " + theData);
|
||||
theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class);
|
||||
if(theHalApiResponse.getDeviceElements() == null) {
|
||||
if(theHalApiResponse == null || theHalApiResponse.getDeviceElements() == null) {
|
||||
StatusDescription theStatus = new Gson().fromJson(theData, StatusDescription.class);
|
||||
if(theStatus.getStatus() == null) {
|
||||
log.warn("Cannot get an devices for type " + deviceType + " for hal " + halAddress.getName() + " as response is not parsable.");
|
||||
@@ -125,9 +125,7 @@ public class HalInfo {
|
||||
HalDevice aNewHalDevice = new HalDevice();
|
||||
aNewHalDevice.setHaldevicetype(deviceType);
|
||||
aNewHalDevice.setHaldevicename(theDevice.getDeviceName());
|
||||
aNewHalDevice.setHaladdress(halAddress.getIp());
|
||||
aNewHalDevice.setHalname(halAddress.getName());
|
||||
aNewHalDevice.setSecure(halAddress.getSecure());
|
||||
aNewHalDevice.setHaladdress(halAddress);
|
||||
deviceList.add(aNewHalDevice);
|
||||
|
||||
}
|
||||
@@ -154,7 +152,7 @@ public class HalInfo {
|
||||
theUrl = "https://";
|
||||
else
|
||||
theUrl = "http://";
|
||||
theUrl = theUrl + halAddress.getIp() + IRBUTTON_REQUEST + TextStringFormatter.forQuerySpaceUrl(theHalDevice.getHaldevicename()) + TOKEN_REQUEST + theToken;
|
||||
theUrl = theUrl + halAddress.getIp() + IRBUTTON_REQUEST + TextStringFormatter.forQuerySpaceUrl(theHalDevice.getHaldevicename()) + TOKEN_REQUEST + halAddress.getPassword();
|
||||
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
||||
if (theData != null) {
|
||||
log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData);
|
||||
@@ -205,6 +203,5 @@ public class HalInfo {
|
||||
httpClient.closeHandler();
|
||||
httpClient = null;
|
||||
halAddress = null;
|
||||
theToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1317,11 +1317,11 @@ app.controller ('SystemController', function ($scope, $location, bridgeService,
|
||||
}
|
||||
}
|
||||
};
|
||||
$scope.addHaltoSettings = function (newhalname, newhalip) {
|
||||
$scope.addHaltoSettings = function (newhalname, newhalip, newhalsecure, newhaltoken) {
|
||||
if($scope.bridge.settings.haladdress === undefined || $scope.bridge.settings.haladdress === null) {
|
||||
$scope.bridge.settings.haladdress = { devices: [] };
|
||||
}
|
||||
var newhal = {name: newhalname, ip: newhalip }
|
||||
var newhal = {name: newhalname, ip: newhalip, secure: newhalsecure, password: newhaltoken }
|
||||
$scope.bridge.settings.haladdress.devices.push(newhal);
|
||||
$scope.newhalname = null;
|
||||
$scope.newhalip = null;
|
||||
@@ -2202,7 +2202,11 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
var preOffCmd = "";
|
||||
var nameCmd = "";
|
||||
var aDeviceType;
|
||||
var postCmd = "?Token=" + $scope.bridge.settings.haltoken;
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
if(haldevice.haldevicetype === "Group") {
|
||||
aDeviceType = "group";
|
||||
preOnCmd = "/GroupService!GroupCmd=On";
|
||||
@@ -2227,29 +2231,29 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
nameCmd = "!DeviceName=";
|
||||
}
|
||||
if((dim_control.indexOf("byte") >= 0 || dim_control.indexOf("percent") >= 0 || dim_control.indexOf("math") >= 0) && aDeviceType === "switch")
|
||||
dimpayload = "http://" + haldevice.haladdress
|
||||
dimpayload = "http://" + haldevice.haladdress.ip
|
||||
+ preDimCmd
|
||||
+ dim_control
|
||||
+ nameCmd
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ postCmd;
|
||||
else
|
||||
dimpayload = "http://" + haldevice.haladdress
|
||||
dimpayload = "http://" + haldevice.haladdress.ip
|
||||
+ preOnCmd
|
||||
+ nameCmd
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ postCmd;
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ preOnCmd
|
||||
+ nameCmd
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ preOffCmd
|
||||
+ nameCmd
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ postCmd;
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname, haldevice.haldevicename, haldevice.halname, aDeviceType, "halDevice", null, null);
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name, haldevice.haldevicename, haldevice.haladdress.name, aDeviceType, "halDevice", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2260,10 +2264,15 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
$scope.buildButtonUrls = function (haldevice, onbutton, offbutton, buildonly) {
|
||||
var actionOn = angular.fromJson(onbutton);
|
||||
var actionOff = angular.fromJson(offbutton);
|
||||
onpayload = "http://" + haldevice.haladdress + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOn.DeviceName.replaceAll(" ", "%20") + "?Token=" + $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOff.DeviceName.replaceAll(" ", "%20") + "?Token=" + $scope.bridge.settings.haltoken;
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOn.DeviceName.replaceAll(" ", "%20") + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOff.DeviceName.replaceAll(" ", "%20") + postCmd;
|
||||
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-" + actionOn.DeviceName, haldevice.haldevicename, haldevice.halname, "button", "halButton", null, null);
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-" + actionOn.DeviceName, haldevice.haldevicename, haldevice.haladdress.name, "button", "halButton", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2272,9 +2281,14 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALHomeUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress + "/ModeService!ModeCmd=Set!ModeName=Home?Token=" + $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress + "/ModeService!ModeCmd=Set!ModeName=Away?Token=" + $scope.bridge.settings.haltoken;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-HomeAway", haldevice.haldevicename, haldevice.halname, "home", "halHome", null, null);
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip + "/ModeService!ModeCmd=Set!ModeName=Home" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip + "/ModeService!ModeCmd=Set!ModeName=Away" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-HomeAway", haldevice.haldevicename, haldevice.haladdress.name, "home", "halHome", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2283,22 +2297,24 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALHeatUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Heat?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
dimpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Heat" + postCmd;
|
||||
dimpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Heat!HeatSpValue=${intensity.percent}?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Heat!HeatSpValue=${intensity.percent}" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Off?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetHeat", haldevice.haldevicename + " Heat", haldevice.halname, "thermo", "halThermoSet", null, null);
|
||||
+ "!HVACMode=Off" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetHeat", haldevice.haldevicename + " Heat", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2307,22 +2323,24 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALCoolUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Cool?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
dimpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Cool" + postCmd;
|
||||
dimpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Cool!CoolSpValue=${intensity.percent}?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Cool!CoolSpValue=${intensity.percent}" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Off?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetCool", haldevice.haldevicename + " Cool", haldevice.halname, "thermo", "halThermoSet", null, null);
|
||||
+ "!HVACMode=Off" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetCool", haldevice.haldevicename + " Cool", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2331,16 +2349,20 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALAutoUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Auto?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Auto" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Off?Token="
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetAuto", haldevice.haldevicename + " Auto", haldevice.halname, "thermo", "halThermoSet", null, null);
|
||||
+ "!HVACMode=Off" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetAuto", haldevice.haldevicename + " Auto", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2349,17 +2371,20 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALOffUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Auto?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
+ "!HVACMode=Auto" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!HVACMode=Off?Token="
|
||||
$scope.device.offUrl = "http://" + haldevice.haladdress
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-TurnOff", haldevice.haldevicename + " Thermostat", haldevice.halname, "thermo", "halThermoSet", null, null);
|
||||
+ "!HVACMode=Off" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-TurnOff", haldevice.haldevicename + " Thermostat", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
@@ -2368,17 +2393,20 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
||||
};
|
||||
|
||||
$scope.buildHALFanUrls = function (haldevice, buildonly) {
|
||||
onpayload = "http://" + haldevice.haladdress
|
||||
var postCmd = "?Token=";
|
||||
if(haldevice.haladdress.password === undefined || haldevice.haladdress.password === null || haldevice.haladdress.password.lenght === 0)
|
||||
postCmd = postCmd + $scope.bridge.settings.haltoken;
|
||||
else
|
||||
postCmd = postCmd + haldevice.haladdress.password;
|
||||
onpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!FanMode=On?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
offpayload = "http://" + haldevice.haladdress
|
||||
+ "!FanMode=On" + postCmd;
|
||||
offpayload = "http://" + haldevice.haladdress.ip
|
||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||
+ "!FanMode=Auto?Token="
|
||||
+ $scope.bridge.settings.haltoken;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetFan", haldevice.haldevicename + " Fan", haldevice.halname, "thermo", "halThermoSet", null, null);
|
||||
+ "!FanMode=Auto" + postCmd;
|
||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetFan", haldevice.haldevicename + " Fan", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||
$scope.device = bridgeService.state.device;
|
||||
if (!buildonly) {
|
||||
bridgeService.editNewDevice($scope.device);
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
ng-click="toggleSelection(haldevice.haldevicename)">
|
||||
{{haldevice.haldevicename}}</td>
|
||||
<td>{{haldevice.haldevicetype}}</td>
|
||||
<td>{{haldevice.halname}}</td>
|
||||
<td>{{haldevice.haladdress.name}}</td>
|
||||
<td>
|
||||
<select name="button-on" id="button-on" ng-model="button_on">
|
||||
<option ng-repeat="aButtonOn in haldevice.buttons.DeviceElements"
|
||||
|
||||
@@ -113,16 +113,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="vera in bridge.settings.veraaddress.devices">
|
||||
<td>{{vera.name}}</td>
|
||||
<td>{{vera.ip}}</td>
|
||||
<td><input id="bridge-settings-next-vera-name"
|
||||
class="form-control" type="text" ng-model="vera.name"
|
||||
placeholder="A Vera"></td>
|
||||
<td><input id="bridge-settings-next-vera-ip"
|
||||
class="form-control" type="text" ng-model="vera.ip"
|
||||
placeholder="192.168.1.2"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeVeratoSettings(vera.name, vera.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-vera-name"
|
||||
<td><input id="bridge-settings-new-vera-name"
|
||||
class="form-control" type="text" ng-model="newveraname"
|
||||
placeholder="A Vera"></td>
|
||||
<td><input id="bridge-settings-next-vera-ip"
|
||||
<td><input id="bridge-settings-new-vera-ip"
|
||||
class="form-control" type="text" ng-model="newveraip"
|
||||
placeholder="192.168.1.2"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
@@ -137,30 +141,36 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>IP</th>
|
||||
<th>Webhook</th>
|
||||
<th>IP</th>
|
||||
<th>Webhook</th>
|
||||
<th>Manage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="harmony in bridge.settings.harmonyaddress.devices">
|
||||
<td>{{harmony.name}}</td>
|
||||
<td>{{harmony.ip}}</td>
|
||||
<td>{{harmony.webhook}}</td>
|
||||
<td><input id="bridge-settings-next-harmony-name"
|
||||
class="form-control" type="text" ng-model="harmony.name"
|
||||
placeholder="A Harmony"></td>
|
||||
<td><input id="bridge-settings-next-harmony-ip"
|
||||
class="form-control" type="text" ng-model="harmony.ip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-harmony-webhook"
|
||||
class="form-control" type="text" ng-model="harmony.webhook"
|
||||
placeholder="http://hook?a=${activity.label}"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeHarmonytoSettings(harmony.name, harmony.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-harmony-name"
|
||||
<td><input id="bridge-settings-new-harmony-name"
|
||||
class="form-control" type="text" ng-model="newharmonyname"
|
||||
placeholder="A Harmony"></td>
|
||||
<td><input id="bridge-settings-next-harmony-ip"
|
||||
class="form-control" type="text" ng-model="newharmonyip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-harmony-webhook"
|
||||
class="form-control" type="text" ng-model="newharmonywebhook"
|
||||
placeholder="http://hook?a=${activity.label}"></td>
|
||||
<td><input id="bridge-settings-new-harmony-ip"
|
||||
class="form-control" type="text" ng-model="newharmonyip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-new-harmony-webhook"
|
||||
class="form-control" type="text" ng-model="newharmonywebhook"
|
||||
placeholder="http://hook?a=${activity.label}"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
ng-click="addHarmonytoSettings(newharmonyname, newharmonyip, newharmonywebhook)">Add</button></td>
|
||||
ng-click="addHarmonytoSettings(newharmonyname, newharmonyip, newharmonywebhook)">Add</button></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
@@ -176,20 +186,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="hue in bridge.settings.hueaddress.devices">
|
||||
<td>{{hue.name}}</td>
|
||||
<td>{{hue.ip}}</td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeHuetoSettings(hue.name, hue.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-hue-name"
|
||||
class="form-control" type="text" ng-model="newhuename"
|
||||
class="form-control" type="text" ng-model="hue.name"
|
||||
placeholder="A Hue"></td>
|
||||
<td><input id="bridge-settings-next-hue-ip"
|
||||
class="form-control" type="text" ng-model="hue.ip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeHuetoSettings(hue.name, hue.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-new-hue-name"
|
||||
class="form-control" type="text" ng-model="newhuename"
|
||||
placeholder="A Hue"></td>
|
||||
<td><input id="bridge-settings-new-hue-ip"
|
||||
class="form-control" type="text" ng-model="newhueip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
ng-click="addHuetoSettings(newhuename, newhueip)">Add</button></td>
|
||||
ng-click="addHuetoSettings(newhuename, newhueip)">Add</button></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
@@ -201,34 +215,47 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>IP</th>
|
||||
<th>Token</th>
|
||||
<th>Use SSL</th>
|
||||
<th>Manage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="hal in bridge.settings.haladdress.devices">
|
||||
<td>{{hal.name}}</td>
|
||||
<td>{{hal.ip}}</td>
|
||||
<td>{{hal.secure}}</td>
|
||||
<td><input id="bridge-settings-next-hal-name"
|
||||
class="form-control" type="text" ng-model="hal.name"
|
||||
placeholder="A Hal"></td>
|
||||
<td><input id="bridge-settings-next-hal-ip"
|
||||
class="form-control" type="text" ng-model="hal.ip"
|
||||
placeholder="192.168.1.3:82"></td>
|
||||
<td><input id="bridge-settings-next-haltoken" class="form-control"
|
||||
type="password" ng-model="hal.password"
|
||||
placeholder="thetoken"></td>
|
||||
<td><input type="checkbox"
|
||||
ng-model="hal.secure" ng-true-value=true
|
||||
ng-false-value=false></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeHaltoSettings(hal.name, hal.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-hal-name"
|
||||
<td><input id="bridge-settings-new-hal-name"
|
||||
class="form-control" type="text" ng-model="newhalname"
|
||||
placeholder="A Hal"></td>
|
||||
<td><input id="bridge-settings-next-hal-ip"
|
||||
<td><input id="bridge-settings-new-hal-ip"
|
||||
class="form-control" type="text" ng-model="newhalip"
|
||||
placeholder="192.168.1.3:82"></td>
|
||||
<td><input id="bridge-settings-new-haltoken" class="form-control"
|
||||
type="password" ng-model="newhaltoken"
|
||||
placeholder="thetoken"></td>
|
||||
<td><input type="checkbox"
|
||||
ng-model="newhalsecure" ng-true-value=true
|
||||
ng-false-value=false></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
ng-click="addHaltoSettings(newhalname, newhalip, newhalsecure)">Add</button></td>
|
||||
ng-click="addHaltoSettings(newhalname, newhalip, newhalsecure, newhaltoken)">Add</button></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HAL Token</td>
|
||||
<td>HAL Token (please use token on individual HAL entry)</td>
|
||||
<td><input id="bridge-settings-haltoken" class="form-control"
|
||||
type="password" ng-model="bridge.settings.haltoken"
|
||||
placeholder="thetoken"></td>
|
||||
@@ -247,26 +274,32 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="mqtt in bridge.settings.mqttaddress.devices">
|
||||
<td>{{mqtt.name}}</td>
|
||||
<td>{{mqtt.ip}}</td>
|
||||
<td>{{mqtt.username}}</td>
|
||||
<td ng-if="mqtt.password">*******</td>
|
||||
<td ng-if="!mqtt.password"> </td>
|
||||
|
||||
<td><input id="bridge-settings-next-mqtt-name"
|
||||
class="form-control" type="text" ng-model="mqtt.name"
|
||||
placeholder="A MQTT Client ID"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-ip"
|
||||
class="form-control" type="text" ng-model="mqtt.ip"
|
||||
placeholder="MQTT Broker IP and port"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-username"
|
||||
class="form-control" type="text" ng-model="mqtt.username"
|
||||
placeholder="MQTT Broker username (optional)"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-password"
|
||||
class="form-control" type="password" ng-model="mqtt.password"
|
||||
placeholder="MQTT Broker password (opt)"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeMQTTtoSettings(mqtt.name, mqtt.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-mqtt-name"
|
||||
<td><input id="bridge-settings-new-mqtt-name"
|
||||
class="form-control" type="text" ng-model="newmqttname"
|
||||
placeholder="A MQTT Client ID"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-ip"
|
||||
<td><input id="bridge-settings-new-mqtt-ip"
|
||||
class="form-control" type="text" ng-model="newmqttip"
|
||||
placeholder="MQTT Broker IP and port"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-username"
|
||||
<td><input id="bridge-settings-new-mqtt-username"
|
||||
class="form-control" type="text" ng-model="newmqttusername"
|
||||
placeholder="MQTT Broker username (optional)"></td>
|
||||
<td><input id="bridge-settings-next-mqtt-password"
|
||||
<td><input id="bridge-settings-new-mqtt-password"
|
||||
class="form-control" type="password" ng-model="newmqttpassword"
|
||||
placeholder="MQTT Broker password (opt)"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
@@ -289,26 +322,35 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="hass in bridge.settings.hassaddress.devices">
|
||||
<td>{{hass.name}}</td>
|
||||
<td>{{hass.ip}}</td>
|
||||
<td>{{hass.port}}</td>
|
||||
<td ng-if="hass.password">*******</td>
|
||||
<td ng-if="!hass.password"> </td>
|
||||
<td>{{hass.secure}}</td>
|
||||
<td><input id="bridge-settings-next-hass-name"
|
||||
class="form-control" type="text" ng-model="hass.name"
|
||||
placeholder="A HomeAssistant"></td>
|
||||
<td><input id="bridge-settings-next-hass-ip"
|
||||
class="form-control" type="text" ng-model="hass.ip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-hass-port"
|
||||
class="form-control" type="text" ng-model="hass.port"
|
||||
placeholder="8123"></td>
|
||||
<td><input id="bridge-settings-next-hass-password"
|
||||
class="form-control" type="password" ng-model="hass.password"
|
||||
placeholder="Home Assistant password (opt)"></td>
|
||||
<td><input type="checkbox"
|
||||
ng-model="hass.secure" ng-true-value=true
|
||||
ng-false-value=false></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeHasstoSettings(hass.name, hass.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-hass-name"
|
||||
<td><input id="bridge-settings-new-hass-name"
|
||||
class="form-control" type="text" ng-model="newhassname"
|
||||
placeholder="A HomeAssistant"></td>
|
||||
<td><input id="bridge-settings-next-hass-ip"
|
||||
<td><input id="bridge-settings-new-hass-ip"
|
||||
class="form-control" type="text" ng-model="newhassip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-hass-port"
|
||||
<td><input id="bridge-settings-new-hass-port"
|
||||
class="form-control" type="text" ng-model="newhassport"
|
||||
placeholder="8123"></td>
|
||||
<td><input id="bridge-settings-next-hass-password"
|
||||
<td><input id="bridge-settings-new-hass-password"
|
||||
class="form-control" type="password" ng-model="newhasspassword"
|
||||
placeholder="Home Assistant password (opt)"></td>
|
||||
<td><input type="checkbox"
|
||||
@@ -334,29 +376,38 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="domoticz in bridge.settings.domoticzaddress.devices">
|
||||
<td>{{domoticz.name}}</td>
|
||||
<td>{{domoticz.ip}}</td>
|
||||
<td>{{domoticz.port}}</td>
|
||||
<td>{{domoticz.username}}</td>
|
||||
<td ng-if="domoticz.password">*******</td>
|
||||
<td ng-if="!domoticz.password"> </td>
|
||||
<td><input id="bridge-settings-next-domoticz-name"
|
||||
class="form-control" type="text" ng-model="domoticz.name"
|
||||
placeholder="A Domoticz"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-ip"
|
||||
class="form-control" type="text" ng-model="domoticz.ip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-port"
|
||||
class="form-control" type="text" ng-model="domoticz.port"
|
||||
placeholder="8080"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-username"
|
||||
class="form-control" type="text" ng-model="domoticz.username"
|
||||
placeholder="Domoticz username"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-password"
|
||||
class="form-control" type="password" ng-model="domoticz.password"
|
||||
placeholder="Domoticz password (opt)"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeDomoticztoSettings(domoticz.name, domoticz.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-domoticz-name"
|
||||
<td><input id="bridge-settings-new-domoticz-name"
|
||||
class="form-control" type="text" ng-model="newdomoticzname"
|
||||
placeholder="A Domoticz"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-ip"
|
||||
<td><input id="bridge-settings-new-domoticz-ip"
|
||||
class="form-control" type="text" ng-model="newdomoticzip"
|
||||
placeholder="192.168.1.3"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-port"
|
||||
<td><input id="bridge-settings-new-domoticz-port"
|
||||
class="form-control" type="text" ng-model="newdomoticzport"
|
||||
placeholder="8080"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-username"
|
||||
<td><input id="bridge-settings-new-domoticz-username"
|
||||
class="form-control" type="text" ng-model="newdomoticzusername"
|
||||
placeholder="Domoticz username"></td>
|
||||
<td><input id="bridge-settings-next-domoticz-password"
|
||||
<td><input id="bridge-settings-new-domoticz-password"
|
||||
class="form-control" type="password" ng-model="newdomoticzpassword"
|
||||
placeholder="Domoticz password (opt)"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
@@ -378,25 +429,32 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="somfy in bridge.settings.somfyaddress.devices">
|
||||
<td>{{somfy.name}}</td>
|
||||
<td>{{somfy.ip}}</td>
|
||||
<td>{{somfy.username}}</td>
|
||||
<td ng-if="somfy.password">*******</td>
|
||||
<td ng-if="!somfy.password"> </td>
|
||||
<td><input id="bridge-settings-next-somfy-name"
|
||||
class="form-control" type="text" ng-model="somfy.name"
|
||||
placeholder="A Somfy"></td>
|
||||
<td><input id="bridge-settings-next-somfy-ip"
|
||||
class="form-control" type="text" ng-model="somfy.ip"
|
||||
placeholder="https://www.tahomalink.com"></td>
|
||||
<td><input id="bridge-settings-next-somfy-username"
|
||||
class="form-control" type="text" ng-model="somfy.username"
|
||||
placeholder="Somfy username"></td>
|
||||
<td><input id="bridge-settings-next-somfy-password"
|
||||
class="form-control" type="password" ng-model="somfy.password"
|
||||
placeholder="Somfy password"></td>
|
||||
<td><button class="btn btn-danger" type="submit"
|
||||
ng-click="removeSomfytoSettings(somfy.name, somfy.ip)">Del</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input id="bridge-settings-next-somfy-name"
|
||||
<td><input id="bridge-settings-new-somfy-name"
|
||||
class="form-control" type="text" ng-model="newsomfyname"
|
||||
placeholder="A Somfy"></td>
|
||||
<td><input id="bridge-settings-next-somfy-ip"
|
||||
<td><input id="bridge-settings-new-somfy-ip"
|
||||
class="form-control" type="text" ng-model="newsomfyip"
|
||||
placeholder="https://www.tahomalink.com"></td>
|
||||
<td><input id="bridge-settings-next-somfy-username"
|
||||
<td><input id="bridge-settings-new-somfy-username"
|
||||
class="form-control" type="text" ng-model="newsomfyusername"
|
||||
placeholder="Somfy username"></td>
|
||||
<td><input id="bridge-settings-next-somfy-password"
|
||||
<td><input id="bridge-settings-new-somfy-password"
|
||||
class="form-control" type="password" ng-model="newsomfypassword"
|
||||
placeholder="Somfy password"></td>
|
||||
<td><button class="btn btn-success" type="submit"
|
||||
|
||||
Reference in New Issue
Block a user