1.2.1 • Published 8 years ago

node-x10-comm v1.2.1

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

Dependency Status

node-x10-comm

Communicate with X10 modules via a CM17A FireCracker interface

Usage

var x10 = require('node-x10-comm');
var comm_name = "COM3";
var house_code = 2; //C
var module_code = 0; //01

x10.listPorts(function (ports) {
  console.log("Available ports:");
  console.log(ports);
}, function (err) {
  console.log("Unable to enumerate available ports");
});

var device = x10.device();
device.open(comm_name, function () {
  device.sendCommand(house_code, module_code, 1, function () {
    console.log("Turned on device C01");
  }, function (err) {
    console.log("Unable to send to device");
  });
}, function (err) {
  console.log(err);
});

Or use promises or async/await:

await device.open(comm_name);
await device.sendCommand(2, 0);
1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago