From 966627384022e2377798cc3b4cae95a391bbe259 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 10 Sep 2015 16:38:36 -0500 Subject: [PATCH] Fixed issue with not adding device by checking for an httpVerb always. --- src/main/resources/public/scripts/app.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index ff0a68e..90a24b1 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -250,9 +250,9 @@ app.controller('ViewingController', function ($scope, $location, bridgeService, }; }); -app.controller('AddingController', function ($scope, bridgeService, BridgeSettings) { +app.controller('AddingController', function ($scope, $location, bridgeService, BridgeSettings) { - $scope.device = {id: "", name: "", deviceType: "switch", onUrl: "", offUrl: "", httpVerb: "", contentType: "", contentBody: ""}; + $scope.device = {id: "", name: "", deviceType: "switch", onUrl: "", offUrl: ""}; $scope.vera = {base: "", port: "3480", id: ""}; $scope.vera.base = "http://" + BridgeSettings.veraaddress; bridgeService.device = $scope.device; @@ -296,6 +296,7 @@ app.controller('AddingController', function ($scope, bridgeService, BridgeSettin if ($scope.vera.base.indexOf("http") < 0) { $scope.vera.base = "http://" + $scope.vera.base; } + $scope.device.deviceType = "switch"; $scope.device.name = veradevice.name; $scope.device.onUrl = $scope.vera.base + ":" + $scope.vera.port + "/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&DeviceNum=" @@ -331,10 +332,10 @@ app.controller('AddingController', function ($scope, bridgeService, BridgeSettin $scope.device.onUrl = ""; $scope.device.deviceType = "switch"; $scope.device.offUrl = ""; - $scope.device.httpVerb = ""; - $scope.device.contentType = ""; - $scope.device.contentBody = ""; - $location.path('/'); + $scope.device.httpVerb = null; + $scope.device.contentType = null; + $scope.device.contentBody = null; + $location.path('/#'); }, function (error) { }