From e5f088cfb980bc43865393a8292be64de1f076fd Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 19 Jan 2017 15:57:33 -0600 Subject: [PATCH] Finished editor update --- pom.xml | 2 +- src/main/resources/public/scripts/app.js | 288 ++++++++---------- .../resources/public/views/haldevice.html | 68 +---- .../public/views/harmonyactivity.html | 60 +--- .../resources/public/views/harmonydevice.html | 56 +--- .../resources/public/views/hassdevice.html | 66 +--- .../resources/public/views/huedevice.html | 45 +-- .../resources/public/views/mqttpublish.html | 53 +--- .../resources/public/views/nestactions.html | 54 +--- .../resources/public/views/veradevice.html | 67 +--- .../resources/public/views/verascene.html | 55 +--- 11 files changed, 187 insertions(+), 627 deletions(-) diff --git a/pom.xml b/pom.xml index 86506b4..ce89ae8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 4beta3.5 + 4beta3.6 jar HA Bridge diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index 3adc131..684be20 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -409,24 +409,30 @@ app.service ('bridgeService', function ($http, $window, ngToast) { ); }; + this.formatCallItem = function (currentItem) { + if(!currentItem.startsWith("{\"item") && !currentItem.startsWith("[{\"item")) { + if (currentItem.startsWith("[") || currentItem.startsWith("{")) + currentItem = "[{\"item\":" + currentItem + "}]"; + else + currentItem = "[{\"item\":\"" + currentItem + "\"}]"; + } else if(currentItem.startsWith("{\"item")) + currentItem = "[" + currentItem + "]"; + + return currentItem; + }; + this.getCallObjects = function (deviceString) { - if (!deviceString.startsWith("[")) { - if (deviceString.startsWith("{\"item")) - deviceString = "[" + deviceString + "]" - else { - if (deviceString.startsWith("{")) - deviceString = "[{\"item\":" + deviceString + "}]" - else - deviceString = "[{\"item\":\"" + deviceString + "\"}]" - } - } else if (!deviceString.startsWith("[{\"item\"")) - deviceString = "[{\"item\":" + deviceString + "}]" + if (deviceString === undefined || deviceString === "") + return null; + + deviceString = self.formatCallItem(deviceString); + var newDevices = angular.fromJson(deviceString) var i, s, len = newDevices.length for (i=0; i
-

For any HAL Device, use the action buttons - to generate the device addition information below automatically. Then +

For any HAL Device, use the build action buttons + to generate the item addition information into the ha-bridge device and this will put you into the edit screen. Then you can modify the name to anything you want that will be the keyword - for Alexa. Click the 'Add Bridge Device' to finish that selection + for Alexa. Also, you can go back to any helper tab and click a build + action button to add another item for a multi-command. After you are + done in the edit tab, click the 'Add Bridge Device' to finish that selection setup. The 'Already Configured HAL Devices' list below will show what is already setup for your HAL.

@@ -60,7 +62,7 @@ HAL On Button Off Button - Actions + Build Actions @@ -86,10 +88,9 @@ + ng-click="buildDeviceUrls(haldevice, device_dim_control)">Build Item + ng-click="buildHALHomeUrls(haldevice)">Build Home/Away @@ -159,59 +160,6 @@

-
-
-

Add Bridge Device for a HAL Device

-
-
-
-
- - -
- -
- -
-
-
- - -
- -
- -
-
-
- - -
- -
-
-
-
-
- - -
- -
-
- -
-