-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.js
More file actions
31 lines (22 loc) · 835 Bytes
/
example.js
File metadata and controls
31 lines (22 loc) · 835 Bytes
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
var rfxcom = require('./index');
var rfxtrx = new rfxcom.RfxCom("/dev/tty.usbserial-DO3O5EMF", {debug: false}),
fireworks = new rfxcom.Lighting4_fireworks(rfxtrx, rfxcom.lighting4.PT2262),
light = new rfxcom.Lighting4_scs_HCN0018(rfxtrx, rfxcom.lighting4.PT2262);
rfxtrx.on("lighting4", function (evt) {
console.log("lighting4 data in:", evt);
});
rfxtrx.initialise(function () {
console.log("Device initialised");
// fireworks.sendData("0xF701B1");
// fireworks.rapidFire(1);
// fireworks.allFire(1);
fireworks.fire(1, 1, function(err, response, cmdId) {
console.log("Transmit OK", err, response, cmdId);
});
light.switchOn(1, (err, response, cmdId) => {
console.log("Transmit OK", err, response, cmdId);
});
// light.switchOff(2);
// light.switchAllOn();
// light.switchAllOff();
});