This commit is contained in:
2017-04-10 21:51:07 +02:00
parent 771e325ae3
commit 8dd7992043
12 changed files with 41 additions and 29 deletions
+6 -4
View File
@@ -69,9 +69,9 @@ function connect(item) {
Log.log('Distance Value: ' + distance);
if(distance < item.value) {
doDoorStateChangedCall(item.on.action.open);
doDoorStateChangedCall(HOST, item.on.action.open);
} else {
doDoorStateChangedCall(item.on.action.closed);
doDoorStateChangedCall(HOST, item.on.action.closed);
}
}
);
@@ -84,9 +84,11 @@ function connect(item) {
}
/* private */
function doDoorStateChangedCall(options) {
function doDoorStateChangedCall(host, options) {
const HOST = host;
Log.inspect('Call options', options);
callback = function(response) {
var str = '';
+2 -2
View File
@@ -9,12 +9,12 @@
"action": {
"timeout": 2000,
"open": {
"host": "hobu",
"host": "hobu.local",
"port": "2999",
"path": "/set/state/of/door/100/to/open/"
},
"closed": {
"host": "hobu",
"host": "hobu.local",
"port": "2999",
"path": "/set/state/of/door/100/to/closed/"
}