Updated editor, put in fix for nest status deserialize, updated

configured items display in tabs
This commit is contained in:
bwssystems
2017-01-10 16:56:53 -06:00
parent b644b5e3cc
commit cd62538785
11 changed files with 223 additions and 288 deletions

View File

@@ -5,7 +5,7 @@
<groupId>com.bwssystems.HABridge</groupId> <groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId> <artifactId>ha-bridge</artifactId>
<version>4beta3.1</version> <version>4beta3.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>HA Bridge</name> <name>HA Bridge</name>
@@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>com.github.bwssytems</groupId> <groupId>com.github.bwssytems</groupId>
<artifactId>nest-controller</artifactId> <artifactId>nest-controller</artifactId>
<version>1.0.12</version> <version>1.0.13</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>

View File

@@ -428,6 +428,8 @@ app.service ('bridgeService', function ($http, $window, ngToast) {
s = newDevices[i]; s = newDevices[i];
if (s.type !== null) if (s.type !== null)
s.type = self.getMapType(s.type) s.type = self.getMapType(s.type)
if (angular.isObject(s.item))
s.item = angular.toJson(s.item)
} }
} }
return newDevices return newDevices
@@ -692,13 +694,6 @@ app.service ('bridgeService', function ($http, $window, ngToast) {
); );
}; };
this.deleteDeviceByMapId = function (id, type) {
for (var i = 0; i < this.state.devices.length; i++) {
if (this.state.devices[i].mapId === id && this.aContainsB(this.state.devices[i].mapType, type))
return self.deleteDevice(this.state.devices[i].id);
}
};
this.editDevice = function (device) { this.editDevice = function (device) {
self.state.device = device; self.state.device = device;
self.state.olddevicename = device.name; self.state.olddevicename = device.name;
@@ -728,7 +723,7 @@ app.service ('bridgeService', function ($http, $window, ngToast) {
return; return;
} }
self.displaySuccess("Request Exceuted: " + msgDescription); self.displaySuccess("Request Executed: " + msgDescription);
}, },
function (error) { function (error) {
self.displayWarn("Request Error, Pleae look in your habridge log: ", error); self.displayWarn("Request Error, Pleae look in your habridge log: ", error);
@@ -1007,13 +1002,9 @@ app.controller('ViewingController', function ($scope, $location, $http, $window,
$scope.comparatorUniqueId = bridgeService.compareUniqueId; $scope.comparatorUniqueId = bridgeService.compareUniqueId;
$scope.testUrl = function (device, type) { $scope.testUrl = function (device, type) {
var dialogNeeded = false; var dialogNeeded = false;
if((type === "on" && (bridgeService.aContainsB(device.onUrl, "${intensity.byte}") || if ((type === "on" && device.onUrl !== undefined && bridgeService.aContainsB(device.onUrl, "${intensity")) ||
bridgeService.aContainsB(device.onUrl, "${intensity.percent}") || (type === "off" && device.offUrl !== undefined && bridgeService.aContainsB(device.offUrl, "${intensity")) ||
bridgeService.aContainsB(device.onUrl, "${intensity.math(")) || (type === "dim" && device.dimUrl !== undefined)) {
(type === "off" && (bridgeService.aContainsB(device.offUrl, "${intensity.byte}") ||
bridgeService.aContainsB(device.offUrl, "${intensity.percent}") ||
bridgeService.aContainsB(device.offUrl, "${intensity.math("))) ||
(type === "dim"))) {
$scope.bridge.device = device; $scope.bridge.device = device;
$scope.bridge.type = type; $scope.bridge.type = type;
ngDialog.open({ ngDialog.open({
@@ -1111,35 +1102,6 @@ app.controller('DeleteDialogCtrl', function ($scope, bridgeService, ngDialog) {
}; };
}); });
app.controller('DeleteMapandIdDialogCtrl', function ($scope, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state;
$scope.mapandid = $scope.bridge.mapandid;
$scope.deleteMapandId = function (mapandid) {
ngDialog.close('ngdialog1');
bridgeService.deleteDeviceByMapId(mapandid.id, mapandid.mapType);
bridgeService.viewDevices();
if(mapandid.mapType === "veraDevice")
bridgeService.viewVeraDevices();
if(mapandid.mapType === "veraScene")
bridgeService.viewVeraScenes();
if(mapandid.mapType === "harmonyActivity")
bridgeService.viewHarmonyActivities();
if(mapandid.mapType === "harmonyButton")
bridgeService.viewHarmonyDevices();
if(mapandid.mapType === "nestThermoSet" || mapandid.mapType === "nestHomeAway")
bridgeService.viewNestItems();
if(mapandid.mapType === "hueDevice")
bridgeService.viewHueDevices();
if(mapandid.mapType === "halDevice")
bridgeService.viewHalDevices();
if(mapandid.mapType === "mqttMessage")
bridgeService.viewMQTTDevices();
if(mapandid.mapType === "hassDevice")
bridgeService.viewHassDevices();
$scope.bridge.mapandid = null;
};
});
app.controller('VeraController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('VeraController', function ($scope, $location, $http, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state; $scope.bridge = bridgeService.state;
$scope.device = bridgeService.state.device; $scope.device = bridgeService.state.device;
@@ -1288,15 +1250,19 @@ app.controller('VeraController', function ($scope, $location, $http, bridgeServi
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('HarmonyController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('HarmonyController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -1357,15 +1323,19 @@ app.controller('HarmonyController', function ($scope, $location, $http, bridgeSe
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('NestController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('NestController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -1455,15 +1425,19 @@ app.controller('NestController', function ($scope, $location, $http, bridgeServi
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('HueController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('HueController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -1582,15 +1556,19 @@ app.controller('HueController', function ($scope, $location, $http, bridgeServic
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('HalController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('HalController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -1865,15 +1843,19 @@ app.controller('HalController', function ($scope, $location, $http, bridgeServic
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('MQTTController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('MQTTController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -1919,15 +1901,19 @@ app.controller('MQTTController', function ($scope, $location, $http, bridgeServi
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('HassController', function ($scope, $location, $http, bridgeService, ngDialog) { app.controller('HassController', function ($scope, $location, $http, bridgeService, ngDialog) {
@@ -2114,30 +2100,37 @@ app.controller('HassController', function ($scope, $location, $http, bridgeServi
$scope.imgButtonsUrl = "glyphicon glyphicon-plus"; $scope.imgButtonsUrl = "glyphicon glyphicon-plus";
}; };
$scope.deleteDeviceByMapId = function (id, mapType) { $scope.deleteDevice = function (device) {
$scope.bridge.mapandid = { id, mapType }; $scope.bridge.device = device;
ngDialog.open({ ngDialog.open({
template: 'deleteMapandIdDialog', template: 'deleteDialog',
controller: 'DeleteMapandIdDialogCtrl', controller: 'DeleteDialogCtrl',
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
}; };
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
};
}); });
app.controller('EditController', function ($scope, $location, $http, bridgeService) { app.controller('EditController', function ($scope, $location, $http, bridgeService) {
bridgeService.viewMapTypes(); bridgeService.viewMapTypes();
$scope.bridge = bridgeService.state; $scope.bridge = bridgeService.state;
$scope.device = bridgeService.state.device; $scope.device = bridgeService.state.device;
$scope.onDevices = null;
$scope.dimDevices = null;
$scope.offDevices = null;
if ($scope.device !== undefined && $scope.device.name !== undefined) { if ($scope.device !== undefined && $scope.device.name !== undefined) {
$scope.onDevices = bridgeService.getCallObjects($scope.bridge.device.onUrl); if($scope.bridge.device.onUrl !== undefined)
$scope.dimDevices = bridgeService.getCallObjects($scope.bridge.device.dimUrl); $scope.onDevices = bridgeService.getCallObjects($scope.bridge.device.onUrl);
$scope.offDevices = bridgeService.getCallObjects($scope.bridge.device.offUrl); if($scope.bridge.device.dimUrl !== undefined)
} else { $scope.dimDevices = bridgeService.getCallObjects($scope.bridge.device.dimUrl);
$scope.onDevices = null; if($scope.bridge.device.offUrl !== undefined)
$scope.dimDevices = null; $scope.offDevices = bridgeService.getCallObjects($scope.bridge.device.offUrl);
$scope.offDevices = null;
} }
$scope.newOnItem = {}; $scope.newOnItem = {};
$scope.newDimItem = {}; $scope.newDimItem = {};
$scope.newOffItem = {}; $scope.newOffItem = {};
@@ -2171,9 +2164,9 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
$scope.device.mapType = $scope.mapTypeSelected[0]; $scope.device.mapType = $scope.mapTypeSelected[0];
if ($scope.onDevices !== null) if ($scope.onDevices !== null)
$scope.device.onUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.onDevices)); $scope.device.onUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.onDevices));
if ($scope.onDevices !== null) if ($scope.dimDevices !== null)
$scope.device.dimUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.dimDevices)); $scope.device.dimUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.dimDevices));
if ($scope.onDevices !== null) if ($scope.offDevices !== null)
$scope.device.offUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.offDevices)); $scope.device.offUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.offDevices));
bridgeService.addDevice($scope.device).then( bridgeService.addDevice($scope.device).then(
function () { function () {
@@ -2186,9 +2179,11 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
}; };
$scope.addItemOn = function (anItem) { $scope.addItemOn = function (anItem) {
if (anItem.item === null || anItem.item === "") if (anItem.item === undefined || anItem.item === null || anItem.item === "")
return; return;
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType }; var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
if ($scope.onDevices === null)
$scope.onDevices = [];
$scope.onDevices.push(newitem); $scope.onDevices.push(newitem);
$scope.newOnItem = []; $scope.newOnItem = [];
}; };
@@ -2201,9 +2196,11 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
}; };
$scope.addItemDim = function (anItem) { $scope.addItemDim = function (anItem) {
if (anItem.item === null || anItem.item === "") if (anItem.item === undefined || anItem.item === null || anItem.item === "")
return; return;
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType }; var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
if ($scope.dimDevices === null)
$scope.dimDevices = [];
$scope.dimDevices.push(newitem); $scope.dimDevices.push(newitem);
$scope.newDimItem = []; $scope.newDimItem = [];
}; };
@@ -2216,9 +2213,11 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
}; };
$scope.addItemOff = function (anItem) { $scope.addItemOff = function (anItem) {
if (anItem.item === null || anItem.item === "") if (anItem.item === undefined || anItem.item === null || anItem.item === "")
return; return;
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType }; var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
if ($scope.offDevices === null)
$scope.offDevices = [];
$scope.offDevices.push(newitem); $scope.offDevices.push(newitem);
$scope.newOffItem = []; $scope.newOffItem = [];
}; };
@@ -2239,13 +2238,13 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
}); });
app.filter('availableHarmonyActivityId', function(bridgeService) { app.filter('configuredVeraDevices', function () {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].activity.id, input[i].hub, "harmonyActivity")){ if(input[i].mapType !== undefined && input[i].mapType !== null && input[i].mapType === "veraDevice"){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2253,13 +2252,13 @@ app.filter('availableHarmonyActivityId', function(bridgeService) {
} }
}); });
app.filter('unavailableHarmonyActivityId', function (bridgeService) { app.filter('configuredVeraScenes', function () {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(bridgeService.findDeviceByMapId(input[i].activity.id, input[i].hub, "harmonyActivity")){ if(input[i].mapType !== undefined && input[i].mapType !== null && input[i].mapType === "veraScene"){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2267,13 +2266,13 @@ app.filter('unavailableHarmonyActivityId', function (bridgeService) {
} }
}); });
app.filter('availableVeraDeviceId', function (bridgeService) { app.filter('configuredNestItems', function (bridgeService) {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].id, input[i].veraname, "veraDevice")){ if(input[i].mapType !== undefined && input[i].mapType !== null && bridgeService.aContainsB(input[i].mapType, "nest")){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2281,13 +2280,13 @@ app.filter('availableVeraDeviceId', function (bridgeService) {
} }
}); });
app.filter('unavailableVeraDeviceId', function (bridgeService) { app.filter('configuredHueItems', function (bridgeService) {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(bridgeService.findDeviceByMapId(input[i].id, input[i].veraname, "veraDevice")){ if(input[i].mapType !== undefined && input[i].mapType !== null && bridgeService.aContainsB(input[i].mapType, "hue")){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2295,106 +2294,7 @@ app.filter('unavailableVeraDeviceId', function (bridgeService) {
} }
}); });
app.filter('availableVeraSceneId', function (bridgeService) { app.filter('configuredHalItems', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].id, input[i].veraname, "veraScene")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableVeraSceneId', function (bridgeService) {
return function(input) {
var out = [];
if(input === null || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(bridgeService.findDeviceByMapId(input[i].id,input[i].veraname, "veraScene")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('availableNestItemId', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findNestItemByMapId(input[i].id, "nestHomeAway")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableNestItemId', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(input[i].mapType !== null && bridgeService.aContainsB(input[i].mapType, "nest")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('availableHueDeviceId', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].device.uniqueid, input[i].huename, "hueDevice")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableHueDeviceId', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(bridgeService.findDeviceByMapId(input[i].device.uniqueid, input[i].huename, "hueDevice")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('availableHalDeviceId', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].haldevicename + "-" + input[i].halname, input[i].halname, "halDevice") &&
!bridgeService.findDeviceByMapId(input[i].haldevicename + "-" + input[i].halname + "-HomeAway", input[i].halname, "halHome") ){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableHalDeviceId', function (bridgeService) {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
@@ -2408,13 +2308,27 @@ app.filter('unavailableHalDeviceId', function (bridgeService) {
} }
}); });
app.filter('configuredButtons', function () { app.filter('configuredHarmonyActivities', function () {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(input[i].mapType !== undefined && input[i].mapType === "harmonyButton"){ if(input[i].mapType !== undefined && input[i].mapType !== null && input[i].mapType === "harmonyActivity"){
out.push(input[i]);
}
}
return out;
}
});
app.filter('configuredHarmonyButtons', function () {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(input[i].mapType !== undefined && input[i].mapType !== null && input[i].mapType === "harmonyButtons"){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2428,7 +2342,7 @@ app.filter('configuredMqttMsgs', function () {
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)
return out; return out;
for (var i = 0; i < input.length; i++) { for (var i = 0; i < input.length; i++) {
if(input[i].mapType !== undefined && input[i].mapType === "mqttMessage"){ if(input[i].mapType !== undefined && input[i].mapType !== null && input[i].mapType === "mqttMessage"){
out.push(input[i]); out.push(input[i]);
} }
} }
@@ -2436,21 +2350,7 @@ app.filter('configuredMqttMsgs', function () {
} }
}); });
app.filter('availableHassDeviceId', function (bridgeService) { app.filter('configuredHassItems', function (bridgeService) {
return function(input) {
var out = [];
if(input === undefined || input === null || input.length === undefined)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].hassdevicename + "-" + input[i].hassname, input[i].hassname, "hassDevice")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableHassDeviceId', function (bridgeService) {
return function(input) { return function(input) {
var out = []; var out = [];
if(input === undefined || input === null || input.length === undefined) if(input === undefined || input === null || input.length === undefined)

View File

@@ -63,7 +63,7 @@
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr ng-repeat="haldevice in bridge.haldevices | availableHalDeviceId"> <tr ng-repeat="haldevice in bridge.haldevices">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td><input type="checkbox" name="bulk.devices[]" <td><input type="checkbox" name="bulk.devices[]"
value="{{haldevice.haldevicename}}" value="{{haldevice.haldevicename}}"
@@ -136,18 +136,24 @@
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="category">Category</th> <th sortable-header col="category">Category</th>
<th sortable-header col="halname">HAL</th> <th sortable-header col="halname">HAL</th>
<th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="device in bridge.devices | unavailableHalDeviceId"> ng-repeat="device in bridge.devices | configuredHalItems">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{device.name}}</td> <td>{{device.name}}</td>
<td>{{device.deviceType}}</td> <td>{{device.deviceType}}</td>
<td>{{device.targetDevice}}</td> <td>{{device.targetDevice}}</td>
<td>{{device.mapId}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(device.mapId, device.mapType)">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -45,7 +45,7 @@
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="harmonyactivity in bridge.harmonyactivities | availableHarmonyActivityId"> ng-repeat="harmonyactivity in bridge.harmonyactivities">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{harmonyactivity.activity.label}}</td> <td>{{harmonyactivity.activity.label}}</td>
<td>{{harmonyactivity.activity.id}}</td> <td>{{harmonyactivity.activity.id}}</td>
@@ -73,19 +73,25 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Id</th> <th sortable-header col="targetDevice">Hub</th>
<th sortable-header col="hub">Hub</th> <th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="harmonyactivity in bridge.harmonyactivities | unavailableHarmonyActivityId"> ng-repeat="device in bridge.devices | configuredHarmonyActivities">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{harmonyactivity.activity.label}}</td> <td>{{device.name}}</td>
<td>{{harmonyactivity.activity.id}}</td> <td>{{device.targetDevice}}</td>
<td>{{harmonyactivity.hub}}</td> <td>{{device.mapId}}</td>
<td><button class="btn btn-danger" type="submit" <td>
ng-click="deleteDeviceByMapId(harmonyactivity.activity.id, 'harmonyActivity')">Delete</button></td> <p>
<button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td>
</tr> </tr>
</table> </table>
</scrollable-table> </scrollable-table>

View File

@@ -94,22 +94,24 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Device Id</th>
<th sortable-header col="targetDevice">Hub</th> <th sortable-header col="targetDevice">Hub</th>
<th>Harmony Device-Button On-Button Off</th> <th>Harmony Device-Button On-Button Off</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="device in bridge.devices | configuredButtons | orderBy:predicate:reverse"> ng-repeat="device in bridge.devices | configuredHarmonyButtons | orderBy:predicate:reverse">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{device.name}}</td> <td>{{device.name}}</td>
<td>{{device.id}}</td>
<td>{{device.targetDevice}}</td> <td>{{device.targetDevice}}</td>
<td>{{device.mapId}}</td> <td>{{device.mapId}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(device.mapId, device.mapType)">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -62,7 +62,7 @@
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr ng-repeat="hassdevice in bridge.hassdevices | availableHassDeviceId"> <tr ng-repeat="hassdevice in bridge.hassdevices">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td><input type="checkbox" name="bulk.devices[]" <td><input type="checkbox" name="bulk.devices[]"
value="{{hassdevice.deviceState.entity_id}}" value="{{hassdevice.deviceState.entity_id}}"
@@ -115,18 +115,24 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="hassname">hass</th> <th sortable-header col="hassname">HomeAssistant</th>
<th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="device in bridge.devices | unavailableHassDeviceId"> ng-repeat="device in bridge.devices | configuredHassItems">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{device.name}}</td> <td>{{device.name}}</td>
<td>{{device.targetDevice}}</td> <td>{{device.targetDevice}}</td>
<td>{{device.mapId}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(device.mapId, device.mapType)">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -51,7 +51,7 @@
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr ng-repeat="huedevice in bridge.huedevices | availableHueDeviceId"> <tr ng-repeat="huedevice in bridge.huedevices">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td><input type="checkbox" name="bulk.devices[]" <td><input type="checkbox" name="bulk.devices[]"
value="{{huedevice.device.uniqueid}}" value="{{huedevice.device.uniqueid}}"
@@ -87,20 +87,24 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Id</th> <th sortable-header col="targetDevice">hue</th>
<th sortable-header col="huename">hue</th> <th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="huedevice in bridge.huedevices | unavailableHueDeviceId"> ng-repeat="device in bridge.devices | configuredHueItems">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{huedevice.device.name}}</td> <td>{{device.name}}</td>
<td>{{huedevice.device.uniqueid}}</td> <td>{{device.targetDevice}}</td>
<td>{{huedevice.huename}}</td> <td>{{device.mapId}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(huedevice.device.uniqueid, 'hueDevice')">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -77,8 +77,8 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="nameclientid">Name</th> <th sortable-header col="nameclientid">Name</th>
<th sortable-header col="ip">ClientID</th> <th sortable-header col="targetDevice">ClientID</th>
<th>MQTT Message ID</th> <th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -89,8 +89,12 @@
<td>{{device.targetDevice}}</td> <td>{{device.targetDevice}}</td>
<td>{{device.mapId}}</td> <td>{{device.mapId}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(device.mapId, device.mapType)">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -45,7 +45,7 @@
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="nestitem in bridge.nestitems | availableNestItemId | orderBy:predicate:reverse"> ng-repeat="nestitem in bridge.nestitems | orderBy:predicate:reverse">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{nestitem.name}}</td> <td>{{nestitem.name}}</td>
<td>{{nestitem.type}}</td> <td>{{nestitem.type}}</td>
@@ -93,19 +93,24 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Device Id</th> <th sortable-header col="id">Location</th>
<th>mapId</th> <th>Map Id</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr ng-repeat="device in bridge.devices | configuredNestItems | orderBy:predicate:reverse">
ng-repeat="device in bridge.devices | unavailableNestItemId | orderBy:predicate:reverse">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{device.name}}</td> <td>{{device.name}}</td>
<td>{{device.id}}</td> <td>{{device.targetDevice}}</td>
<td>{{device.mapId}}</td> <td>{{device.mapId}}</td>
<td><button class="btn btn-danger" type="submit" <td>
ng-click="deleteDeviceByMapId(device.mapId, 'nest')">Delete</button></td> <p>
<button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td>
</tr> </tr>
</table> </table>
</scrollable-table> </scrollable-table>

View File

@@ -63,7 +63,7 @@
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="veradevice in bridge.veradevices | availableVeraDeviceId"> ng-repeat="veradevice in bridge.veradevices">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td><input type="checkbox" name="bulk.devices[]" <td><input type="checkbox" name="bulk.devices[]"
value="{{veradevice.id}}" value="{{veradevice.id}}"
@@ -95,30 +95,30 @@
class={{imgButtonsUrl}} aria-hidden="true"></span></a></a> class={{imgButtonsUrl}} aria-hidden="true"></span></a></a>
</h2> </h2>
</div> </div>
<scrollable-table ng-if="buttonsVisible" watch="bridge.veradevices"> <scrollable-table ng-if="buttonsVisible" watch="bridge.devices">
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Id</th> <th sortable-header col="targetDevice">Vera</th>
<th sortable-header col="category">Category</th> <th>Map Id</th>
<th sortable-header col="room">Room</th>
<th sortable-header col="veraname">Vera</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="veradevice in bridge.veradevices | unavailableVeraDeviceId"> ng-repeat="device in bridge.devices | configuredVeraDevices">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{veradevice.name}}</td> <td>{{device.name}}</td>
<td>{{veradevice.id}}</td> <td>{{device.targetDevice}}</td>
<td>{{veradevice.category}}</td> <td>{{device.mapId}}</td>
<td>{{veradevice.room}}</td>
<td>{{veradevice.veraname}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(veradevice.id, 'veraDevice')">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -44,7 +44,7 @@
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr ng-repeat="verascene in bridge.verascenes | availableVeraSceneId"> <tr ng-repeat="verascene in bridge.verascenes">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{verascene.name}}</td> <td>{{verascene.name}}</td>
<td>{{verascene.id}}</td> <td>{{verascene.id}}</td>
@@ -72,22 +72,24 @@
<tr> <tr>
<th>Row</th> <th>Row</th>
<th sortable-header col="name">Name</th> <th sortable-header col="name">Name</th>
<th sortable-header col="id">Id</th> <th sortable-header col="targetDevice">Vera</th>
<th sortable-header col="room">Room</th> <th>Map Id</th>
<th sortable-header col="veraname">Vera</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tr <tr
ng-repeat="verascene in bridge.verascenes | unavailableVeraSceneId"> ng-repeat="device in bridge.devices | configuredVeraScenes">
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td>{{verascene.name}}</td> <td>{{device.name}}</td>
<td>{{verascene.id}}</td> <td>{{device.targetDevice}}</td>
<td>{{verascene.room}}</td> <td>{{device.mapId}}</td>
<td>{{verascene.veraname}}</td>
<td> <td>
<button class="btn btn-danger" type="submit" <p>
ng-click="deleteDeviceByMapId(verascene.id, 'veraScene')">Delete</button> <button class="btn btn-warning" type="submit"
ng-click="editDevice(device)">Edit</button>
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
</td> </td>
</tr> </tr>
</table> </table>