diff --git a/pom.xml b/pom.xml
index 307bd0b..f369dcc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.bwssystems.HABridge
ha-bridge
- 2.0.3
+ 2.0.4
jar
HA Bridge
diff --git a/src/main/java/com/bwssystems/HABridge/hue/HueMulator.java b/src/main/java/com/bwssystems/HABridge/hue/HueMulator.java
index 2c67da0..adc425c 100644
--- a/src/main/java/com/bwssystems/HABridge/hue/HueMulator.java
+++ b/src/main/java/com/bwssystems/HABridge/hue/HueMulator.java
@@ -752,8 +752,10 @@ public class HueMulator implements HueErrorStringSet {
response = httpClient.execute(request);
log.debug((httpVerb == null?"GET":httpVerb) + " execute on URL responded: " + response.getStatusLine().getStatusCode());
if(response.getStatusLine().getStatusCode() >= 200 && response.getStatusLine().getStatusCode() < 300){
- theContent = EntityUtils.toString(response.getEntity(), Charset.forName("UTF-8")); //read content for data
- EntityUtils.consume(response.getEntity()); //close out inputstream ignore content
+ if(response.getEntity() != null ) {
+ theContent = EntityUtils.toString(response.getEntity(), Charset.forName("UTF-8")); //read content for data
+ EntityUtils.consume(response.getEntity()); //close out inputstream ignore content
+ }
}
} catch (IOException e) {
log.warn("Error calling out to HA gateway: IOException in log", e);
diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js
index 8a904b5..fbe4ee6 100644
--- a/src/main/resources/public/scripts/app.js
+++ b/src/main/resources/public/scripts/app.js
@@ -47,7 +47,7 @@ app.run( function (bridgeService) {
app.service('bridgeService', function ($http, $window, ngToast) {
var self = this;
- this.state = {base: window.location.origin + "/api/devices", bridgelocation: window.location.origin, systemsbase: window.location.origin + "/system", huebase: window.location.origin + "/api", configs: [], backups: [], devices: [], device: [], type: "", settings: [], myToastMsg: [], logMsgs: [], loggerInfo: [], olddevicename: "", logShowAll: false, isInControl: false, showVera: false, showHarmony: false, showNest: false, showHue: false, habridgeversion: ""};
+ this.state = {base: window.location.origin + "/api/devices", bridgelocation: window.location.origin, systemsbase: window.location.origin + "/system", huebase: window.location.origin + "/api", configs: [], backups: [], devices: [], device: [], mapandid: [], type: "", settings: [], myToastMsg: [], logMsgs: [], loggerInfo: [], olddevicename: "", logShowAll: false, isInControl: false, showVera: false, showHarmony: false, showNest: false, showHue: false, habridgeversion: ""};
this.displayWarn = function(errorTitle, error) {
var toastContent = errorTitle;
@@ -324,6 +324,7 @@ app.service('bridgeService', function ($http, $window, ngToast) {
this.bulkAddDevice = function (devices) {
return $http.post(this.state.base, devices).then(
function (response) {
+ self.displaySuccess("Bulk device add successful.");
},
function (error) {
self.displayWarn("Bulk Add new Device Error: ", error);
@@ -724,7 +725,12 @@ app.controller('ViewingController', function ($scope, $location, $http, $window,
bridgeService.testUrl(device, type);
};
$scope.deleteDevice = function (device) {
- bridgeService.deleteDevice(device.id);
+ $scope.bridge.device = device;
+ ngDialog.open({
+ template: 'deleteDialog',
+ controller: 'DeleteDialogCtrl',
+ className: 'ngdialog-theme-default'
+ });
};
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
@@ -789,7 +795,36 @@ app.controller('ValueDialogCtrl', function ($scope, bridgeService, ngDialog) {
};
});
-app.controller('VeraController', function ($scope, $location, $http, bridgeService) {
+app.controller('DeleteDialogCtrl', function ($scope, bridgeService, ngDialog) {
+ $scope.bridge = bridgeService.state;
+ $scope.device = $scope.bridge.device;
+ $scope.deleteDevice = function (device) {
+ ngDialog.close('ngdialog1');
+ bridgeService.deleteDevice(device.id);
+ bridgeService.viewDevices();
+ $scope.bridge.device = null;
+ $scope.bridge.type = "";
+ };
+});
+
+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();
+ bridgeService.viewVeraDevices();
+ bridgeService.viewVeraScenes();
+ bridgeService.viewHarmonyActivities();
+ bridgeService.viewHarmonyDevices();
+ bridgeService.viewNestItems();
+ bridgeService.viewHueDevices();
+ $scope.bridge.mapandid = null;
+ };
+});
+
+app.controller('VeraController', function ($scope, $location, $http, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state;
$scope.device = $scope.bridge.device;
$scope.device_dim_control = "";
@@ -919,15 +954,17 @@ app.controller('VeraController', function ($scope, $location, $http, bridgeServi
};
$scope.deleteDeviceByMapId = function (id, mapType) {
- bridgeService.deleteDeviceByMapId(id, mapType);
- bridgeService.viewDevices();
- bridgeService.viewVeraDevices();
- bridgeService.viewVeraScenes();
+ $scope.bridge.mapandid = { id, mapType };
+ ngDialog.open({
+ template: 'deleteMapandIdDialog',
+ controller: 'DeleteMapandIdDialogCtrl',
+ className: 'ngdialog-theme-default'
+ });
};
});
-app.controller('HarmonyController', function ($scope, $location, $http, bridgeService) {
+app.controller('HarmonyController', function ($scope, $location, $http, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state;
$scope.device = $scope.bridge.device;
bridgeService.viewHarmonyActivities();
@@ -996,15 +1033,17 @@ app.controller('HarmonyController', function ($scope, $location, $http, bridgeSe
};
$scope.deleteDeviceByMapId = function (id, mapType) {
- bridgeService.deleteDeviceByMapId(id, mapType);
- bridgeService.viewDevices();
- bridgeService.viewHarmonyActivities();
- bridgeService.viewHarmonyDevices();
+ $scope.bridge.mapandid = { id, mapType };
+ ngDialog.open({
+ template: 'deleteMapandIdDialog',
+ controller: 'DeleteMapandIdDialogCtrl',
+ className: 'ngdialog-theme-default'
+ });
};
});
-app.controller('NestController', function ($scope, $location, $http, bridgeService) {
+app.controller('NestController', function ($scope, $location, $http, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state;
$scope.device = $scope.bridge.device;
bridgeService.viewNestItems();
@@ -1116,14 +1155,17 @@ app.controller('NestController', function ($scope, $location, $http, bridgeServi
};
$scope.deleteDeviceByMapId = function (id, mapType) {
- bridgeService.deleteDeviceByMapId(id, mapType);
- bridgeService.viewDevices();
- bridgeService.viewNestItems();
+ $scope.bridge.mapandid = { id, mapType };
+ ngDialog.open({
+ template: 'deleteMapandIdDialog',
+ controller: 'DeleteMapandIdDialogCtrl',
+ className: 'ngdialog-theme-default'
+ });
};
});
-app.controller('HueController', function ($scope, $location, $http, bridgeService) {
+app.controller('HueController', function ($scope, $location, $http, bridgeService, ngDialog) {
$scope.bridge = bridgeService.state;
$scope.device = $scope.bridge.device;
$scope.bulk = { devices: [] };
@@ -1168,7 +1210,7 @@ app.controller('HueController', function ($scope, $location, $http, bridgeServic
var devicesList = [];
for(var i = 0; i < $scope.bulk.devices.length; i++) {
for(var x = 0; x < bridgeService.state.huedevices.length; x++) {
- if(bridgeService.state.huedevices[x].id == $scope.bulk.devices[i]) {
+ if(bridgeService.state.huedevices[x].device.uniqueid == $scope.bulk.devices[i]) {
$scope.buildDeviceUrls(bridgeService.state.huedevices[x]);
devicesList[i] = {
name: $scope.device.name,
@@ -1217,9 +1259,12 @@ app.controller('HueController', function ($scope, $location, $http, bridgeServic
};
$scope.deleteDeviceByMapId = function (id, mapType) {
- bridgeService.deleteDeviceByMapId(id, mapType);
- bridgeService.viewDevices();
- bridgeService.viewHueDevices();
+ $scope.bridge.mapandid = { id, mapType };
+ ngDialog.open({
+ template: 'deleteMapandIdDialog',
+ controller: 'DeleteMapandIdDialogCtrl',
+ className: 'ngdialog-theme-default'
+ });
};
});
diff --git a/src/main/resources/public/views/configuration.html b/src/main/resources/public/views/configuration.html
index a665c80..5e224e3 100644
--- a/src/main/resources/public/views/configuration.html
+++ b/src/main/resources/public/views/configuration.html
@@ -103,4 +103,14 @@
+
\ No newline at end of file
diff --git a/src/main/resources/public/views/harmonyactivity.html b/src/main/resources/public/views/harmonyactivity.html
index eba99c7..fc6ddcd 100644
--- a/src/main/resources/public/views/harmonyactivity.html
+++ b/src/main/resources/public/views/harmonyactivity.html
@@ -11,7 +11,7 @@
Manual Add
-
+
Harmony Activity List
@@ -75,7 +75,7 @@
-
+
Add a Bridge Device for a Harmony Activity
@@ -121,3 +121,13 @@
+
diff --git a/src/main/resources/public/views/harmonydevice.html b/src/main/resources/public/views/harmonydevice.html
index 5f43ad9..4f61947 100644
--- a/src/main/resources/public/views/harmonydevice.html
+++ b/src/main/resources/public/views/harmonydevice.html
@@ -11,7 +11,7 @@
Manual Add
-
+
Harmony Device List
@@ -96,7 +96,7 @@
-
+
Add a Bridge Device for Harmony Buttons
@@ -142,3 +142,13 @@
+
diff --git a/src/main/resources/public/views/huedevice.html b/src/main/resources/public/views/huedevice.html
index cfa33a2..7958aca 100644
--- a/src/main/resources/public/views/huedevice.html
+++ b/src/main/resources/public/views/huedevice.html
@@ -11,7 +11,7 @@
Manual Add
-
+
-
+
Add Bridge Device for a Hue Device
@@ -117,3 +117,13 @@
+
diff --git a/src/main/resources/public/views/nestactions.html b/src/main/resources/public/views/nestactions.html
index b737280..b636850 100644
--- a/src/main/resources/public/views/nestactions.html
+++ b/src/main/resources/public/views/nestactions.html
@@ -11,7 +11,7 @@
Manual Add
-
+
Nest Items List
@@ -97,7 +97,7 @@
-
+
Add a Bridge Device for a Nest Item
@@ -143,3 +143,13 @@
+
diff --git a/src/main/resources/public/views/veradevice.html b/src/main/resources/public/views/veradevice.html
index a9106a9..6e75cff 100644
--- a/src/main/resources/public/views/veradevice.html
+++ b/src/main/resources/public/views/veradevice.html
@@ -11,7 +11,7 @@
Manual Add
-
+
Vera Device List ({{bridge.veradevices.length}})
@@ -24,7 +24,7 @@
control you would like to be generated:
@@ -100,7 +100,7 @@
-
+
Add Bridge Device for a Vera Device
@@ -155,3 +155,13 @@
+
diff --git a/src/main/resources/public/views/verascene.html b/src/main/resources/public/views/verascene.html
index e126054..0fbbde7 100644
--- a/src/main/resources/public/views/verascene.html
+++ b/src/main/resources/public/views/verascene.html
@@ -11,7 +11,7 @@
Manual Add
-
+
Vera Scene List
@@ -81,7 +81,7 @@
-
+
Add a Bridge Device for a Vera scene
@@ -125,3 +125,13 @@
+