Continuation of nest implementation

This commit is contained in:
Admin
2016-01-12 16:34:05 -06:00
parent 32a5f26ddd
commit 8687f3482a
4 changed files with 49 additions and 12 deletions

View File

@@ -575,6 +575,15 @@ app.controller('AddingController', function ($scope, $location, $http, bridgeSer
$scope.device.offUrl = "{\"device\":\"" + harmonydevice.device.id + "\",\"button\":\"" + offbutton + "\"}";
};
$scope.buildNestHomeUrls = function (nestitem, onbutton, offbutton) {
$scope.device.deviceType = "home";
$scope.device.name = nestitem.name;
$scope.device.mapType = "nestHomeAway";
$scope.device.mapId = nestitem.Id;
$scope.device.onUrl = "{\"name\":\"" + nestitem.Id + "\",\"away\":false}";
$scope.device.offUrl = "{\"name\":\"" + nestitem.Id + "\",\"away\":true}";
};
$scope.testUrl = function (device, type) {
bridgeService.testUrl(device, type);
};
@@ -723,6 +732,34 @@ return function(input) {
}
});
app.filter('availableNestItemId', function(bridgeService) {
return function(input) {
var out = [];
if(input == null)
return out;
for (var i = 0; i < input.length; i++) {
if(!bridgeService.findDeviceByMapId(input[i].Id, null, "nestHomeAway")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('unavailableNestItemId', function(bridgeService) {
return function(input) {
var out = [];
if(input == null)
return out;
for (var i = 0; i < input.length; i++) {
if(bridgeService.findDeviceByMapId(input[i].Id, null, "nestHomeAway")){
out.push(input[i]);
}
}
return out;
}
});
app.filter('configuredButtons', function() {
return function(input) {
var out = [];