Updates
This commit is contained in:
13
conf/resources/scripts/conditions/Any sensor tripped.js
Normal file
13
conf/resources/scripts/conditions/Any sensor tripped.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// gets each sensor passed in by their uid and
|
||||
// then returns true if any of them are tripped
|
||||
anyTripped = false;
|
||||
|
||||
for (var key in uidTags) {
|
||||
var uidThing = mcApi.uidTag().getByUid(uidTags[key]);
|
||||
if (uidThing && uidThing.getResource().value === "1") {
|
||||
anyTripped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
anyTripped;
|
||||
@@ -1,4 +0,0 @@
|
||||
northDoorOpen = mcApi.uidTag().getByUid("north-garage-door-tripped").getResource();
|
||||
southDoorOpen = mcApi.uidTag().getByUid("south-garage-door-tripped").getResource();
|
||||
|
||||
!northDoorOpen || !southDoorOpen
|
||||
13
conf/resources/scripts/conditions/No sensors tripped.js
Normal file
13
conf/resources/scripts/conditions/No sensors tripped.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// gets each sensor passed in by their uid and
|
||||
// then returns true if none of them are tripped
|
||||
noneTripped = true;
|
||||
|
||||
for (var key in uidTags) {
|
||||
var uidThing = mcApi.uidTag().getByUid(uidTags[key]);
|
||||
if (uidThing && uidThing.getResource().value === "1") {
|
||||
noneTripped = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
noneTripped;
|
||||
8
conf/resources/scripts/operations/Disable timer.js
Normal file
8
conf/resources/scripts/operations/Disable timer.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// disables a timer with the 'timeName' binding passed in
|
||||
filter = new java.util.HashMap();
|
||||
filter.put('name', timerName);
|
||||
|
||||
timer = mcApi.timer().get(filter);
|
||||
if (timer) {
|
||||
mcApi.timer().disable([timer.id]);
|
||||
}
|
||||
8
conf/resources/scripts/operations/Enable Timer.js
Normal file
8
conf/resources/scripts/operations/Enable Timer.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// enables a timer with the 'timeName' binding passed in
|
||||
filter = new java.util.HashMap();
|
||||
filter.put('name', timerName);
|
||||
|
||||
timer = mcApi.timer().get(filter);
|
||||
if (timer) {
|
||||
mcApi.timer().enable([timer.id]);
|
||||
}
|
||||
Reference in New Issue
Block a user