mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 00:20:26 +00:00
Continuation of nest implementation
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>1.2.3c</version>
|
<version>1.2.3d</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -575,6 +575,15 @@ app.controller('AddingController', function ($scope, $location, $http, bridgeSer
|
|||||||
$scope.device.offUrl = "{\"device\":\"" + harmonydevice.device.id + "\",\"button\":\"" + offbutton + "\"}";
|
$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) {
|
$scope.testUrl = function (device, type) {
|
||||||
bridgeService.testUrl(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() {
|
app.filter('configuredButtons', function() {
|
||||||
return function(input) {
|
return function(input) {
|
||||||
var out = [];
|
var out = [];
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
<option value="veraScene">Vera Scene</option>
|
<option value="veraScene">Vera Scene</option>
|
||||||
<option value="harmonyActivity">Harmony Activity</option>
|
<option value="harmonyActivity">Harmony Activity</option>
|
||||||
<option value="harmonyButton">Harmony Button</option>
|
<option value="harmonyButton">Harmony Button</option>
|
||||||
|
<option value="nestHomeAway">Nest Home Status</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<p class="text-muted">You can select a Nest item and generate
|
<p class="text-muted">You can select a Nest item and generate
|
||||||
the add activity box selections automatically.</p>
|
the add nest item box selections automatically.</p>
|
||||||
|
|
||||||
<table class="table table-bordered table-striped table-hover">
|
<table class="table table-bordered table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -41,15 +41,14 @@
|
|||||||
<td>{{nestitem.location}}</td>
|
<td>{{nestitem.location}}</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-success" type="submit"
|
<button class="btn btn-success" type="submit"
|
||||||
ng-click="buildNestUrls(nestitem)">Generate
|
ng-click="buildNestHomeUrls(nestitem)">Gen Home URLs</button>
|
||||||
Activity URLs</button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h2 class="panel-title">Already Configured Activities <a ng-click="toggleActivities()"><span class={{imgActivitiesUrl}} aria-hidden="true"></a></h2>
|
<h2 class="panel-title">Already Configured Nest Items <a ng-click="toggleActivities()"><span class={{imgActivitiesUrl}} aria-hidden="true"></a></h2>
|
||||||
</div>
|
</div>
|
||||||
<ul ng-if="activitiesVisible" class="list-group">
|
<ul ng-if="activitiesVisible" class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@@ -57,16 +56,16 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<a href="" ng-click="order('label')">Name</a>
|
<a href="" ng-click="order('name')">Name</a>
|
||||||
<span class="sortorder" ng-show="predicate === 'name'" ng-class="{reverse:reverse}"></span>
|
<span class="sortorder" ng-show="predicate === 'name'" ng-class="{reverse:reverse}"></span>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<a href="" ng-click="order('id')">Id</a>
|
<a href="" ng-click="order('type')">Type</a>
|
||||||
<span class="sortorder" ng-show="predicate === 'id'" ng-class="{reverse:reverse}"></span>
|
<span class="sortorder" ng-show="predicate === 'id'" ng-class="{reverse:reverse}"></span>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<a href="" ng-click="order('hub')">Hub</a>
|
<a href="" ng-click="order('location')">Location</a>
|
||||||
<span class="sortorder" ng-show="predicate === 'hub'" ng-class="{reverse:reverse}"></span>
|
<span class="sortorder" ng-show="predicate === 'location'" ng-class="{reverse:reverse}"></span>
|
||||||
</th>
|
</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -76,7 +75,7 @@
|
|||||||
<td>{{nestitem.type}}</td>
|
<td>{{nestitem.type}}</td>
|
||||||
<td>{{nestitem.location}}</td>
|
<td>{{nestitem.location}}</td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="deleteDeviceByMapId(nestitem.activity.id, 'nestitem')">Delete</button></td>
|
ng-click="deleteDeviceByMapId(nestitem.Id, 'nestHomeAway')">Delete</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</li>
|
</li>
|
||||||
@@ -84,7 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default bridgeServer" ng-if="!bridge.error">
|
<div class="panel panel-default bridgeServer" ng-if="!bridge.error">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h2 class="panel-title">Add a Harmony Activity</h2>
|
<h2 class="panel-title">Add a Nest Item</h2>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@@ -98,7 +97,7 @@
|
|||||||
ng-model="device.name" placeholder="Device Name">
|
ng-model="device.name" placeholder="Device Name">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="col-xs-4 col-sm-2 btn btn-primary">
|
<button type="submit" class="col-xs-4 col-sm-2 btn btn-primary">
|
||||||
Add Activity</button>
|
Add Nest Item</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user