forked from adomotic/node-zwave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (31 loc) · 1.08 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var zwave = require('./src/node-zwave');
var promise = zwave.connect('/dev/ttyUSB0');
//var promise = zwave.connect();
promise.then(function(connection) {
console.log("I connected! Sweet!");
//console.log(zwave);
/*
var nodes = zwave.getNodes();
nodes.then(function(data){
console.log('woot! '+data);
});
zwave.getNodes(function(data){
//console.log('Woot!! '+data);
//console.log(data);
//console.log(data.length);
for(var i=0;i<data.length;i++){
console.log('looking for' +i+ ': '+data[i])
//zwave.getNodeProtocol(data[i],function(node){console.log(node);});
}
});
*/
//zwave.associateNode(5,function(node){console.log(node);});
//zwave.getNodeProtocol(2,function(node){console.log(node);});
//zwave.getNodeProtocol(3,function(node){console.log(node);});
//zwave.getNodeAbilities(2);
//zwave.getNodeAbilities(3);
//zwave.getNodeAbilities(4);
//zwave.getNodeAbilities(5);
//zwave.thermostat.setMode(5,'heat');
//zwave.thermostat.setSetpoint(5, 62, 'heating');
}).catch(function (error) {console.log(error)});