From 8687f3482ac295b64745c968b431c5dfdf5458e6 Mon Sep 17 00:00:00 2001 From: Admin Date: Tue, 12 Jan 2016 16:34:05 -0600 Subject: [PATCH] Continuation of nest implementation --- pom.xml | 2 +- src/main/resources/public/scripts/app.js | 37 +++++++++++++++++++ .../resources/public/views/editdevice.html | 1 + .../resources/public/views/nestactions.html | 21 +++++------ 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index cbc19a5..ee35e00 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 1.2.3c + 1.2.3d jar HA Bridge diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index 7721dff..e54a427 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -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 = []; diff --git a/src/main/resources/public/views/editdevice.html b/src/main/resources/public/views/editdevice.html index 14c7508..1907a22 100644 --- a/src/main/resources/public/views/editdevice.html +++ b/src/main/resources/public/views/editdevice.html @@ -48,6 +48,7 @@ + diff --git a/src/main/resources/public/views/nestactions.html b/src/main/resources/public/views/nestactions.html index ccdff34..9bb46fc 100644 --- a/src/main/resources/public/views/nestactions.html +++ b/src/main/resources/public/views/nestactions.html @@ -15,7 +15,7 @@
-

Already Configured Activities

+

Already Configured Nest Items