mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 08:28:46 +00:00
Fixes post merge to comply with updated js code json
This commit is contained in:
@@ -72,8 +72,8 @@ public class SomfyHome implements Home {
|
|||||||
} else {
|
} else {
|
||||||
if (anItem.getType() != null && anItem.getType().trim().equalsIgnoreCase(DeviceMapTypes.SOMFY_DEVICE[DeviceMapTypes.typeIndex])) {
|
if (anItem.getType() != null && anItem.getType().trim().equalsIgnoreCase(DeviceMapTypes.SOMFY_DEVICE[DeviceMapTypes.typeIndex])) {
|
||||||
|
|
||||||
log.debug("executing HUE api request to change activity to Somfy: " + anItem.getItem().getAsString());
|
log.debug("executing HUE api request to change activity to Somfy: " + anItem.getItem().toString());
|
||||||
String jsonToPost = anItem.getItem().getAsString();
|
String jsonToPost = anItem.getItem().toString();
|
||||||
|
|
||||||
SomfyInfo somfyHandler = getSomfyHandler(device.getTargetDevice());
|
SomfyInfo somfyHandler = getSomfyHandler(device.getTargetDevice());
|
||||||
if(somfyHandler == null) {
|
if(somfyHandler == null) {
|
||||||
|
|||||||
@@ -2462,7 +2462,7 @@ app.controller('SomfyController', function ($scope, $location, $http, bridgeServ
|
|||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildDeviceUrls = function (somfydevice) {
|
$scope.buildDeviceUrls = function (somfydevice, dim_control, buildonly) {
|
||||||
//TODO - support partial window opening - add back 'dim_control' second param in here, and in somfydevice.html
|
//TODO - support partial window opening - add back 'dim_control' second param in here, and in somfydevice.html
|
||||||
dimpayload = "";
|
dimpayload = "";
|
||||||
onpayload = "{\"label\":\"Label that is ignored probably\",\"actions\":[{\"deviceURL\":\""+ somfydevice.deviceUrl+"\",\"commands\":[{\"name\":\"open\",\"parameters\":[]}]}]}";
|
onpayload = "{\"label\":\"Label that is ignored probably\",\"actions\":[{\"deviceURL\":\""+ somfydevice.deviceUrl+"\",\"commands\":[{\"name\":\"open\",\"parameters\":[]}]}]}";
|
||||||
@@ -2470,18 +2470,20 @@ app.controller('SomfyController', function ($scope, $location, $http, bridgeServ
|
|||||||
|
|
||||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, true, somfydevice.id, somfydevice.name, somfydevice.somfyname, "switch", "somfyDevice", null, null);
|
bridgeService.buildUrls(onpayload, dimpayload, offpayload, true, somfydevice.id, somfydevice.name, somfydevice.somfyname, "switch", "somfyDevice", null, null);
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
bridgeService.editNewDevice($scope.device);
|
if (!buildonly) {
|
||||||
$location.path('/editdevice');
|
bridgeService.editNewDevice($scope.device);
|
||||||
|
$location.path('/editdevice');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.bulkAddDevices = function(dim_control) {
|
$scope.bulkAddDevices = function(dim_control) {
|
||||||
var devicesList = [];
|
var devicesList = [];
|
||||||
|
$scope.clearDevice();
|
||||||
for(var i = 0; i < $scope.bulk.devices.length; i++) {
|
for(var i = 0; i < $scope.bulk.devices.length; i++) {
|
||||||
for(var x = 0; x < bridgeService.state.somfydevices.length; x++) {
|
for(var x = 0; x < bridgeService.state.somfydevices.length; x++) {
|
||||||
if(bridgeService.state.somfydevices[x].id === $scope.bulk.devices[i]) {
|
if(bridgeService.state.somfydevices[x].id === $scope.bulk.devices[i]) {
|
||||||
$scope.buildDeviceUrls(bridgeService.state.somfydevices[x],dim_control);
|
$scope.buildDeviceUrls(bridgeService.state.somfydevices[x],dim_control, true);
|
||||||
devicesList[i] = {
|
devicesList[i] = {
|
||||||
name: $scope.device.name,
|
name: $scope.device.name,
|
||||||
mapId: $scope.device.mapId,
|
mapId: $scope.device.mapId,
|
||||||
@@ -2498,6 +2500,7 @@ app.controller('SomfyController', function ($scope, $location, $http, bridgeServ
|
|||||||
contentBodyDim: $scope.device.contentBodyDim,
|
contentBodyDim: $scope.device.contentBodyDim,
|
||||||
contentBodyOff: $scope.device.contentBodyOff
|
contentBodyOff: $scope.device.contentBodyOff
|
||||||
};
|
};
|
||||||
|
$scope.clearDevice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user