Node.js module to connect to a LIRC daemon.
npm install lirc-client
var lirc = require('lirc-client')({
host: '127.0.0.1',
port: 8765
});
lirc.on('connect', function () {
lirc.cmd('VERSION', function (err, res) {
console.log('LIRC Version', res);
});
lirc.cmd('SEND_ONCE', 'Remote1', 'Key1', function (err) {
if (err) console.log(err);
});
});
lirc.on('receive', function (remote, button, repeat) {
console.log('button ' + button + ' on remote ' + remote + ' was pressed!');
});
you can also connect to a unix domain socket via path option:
var lirc = require('lirc-client')({
path: '/var/run/lirc/lircd'
});
see available commands here: http://www.lirc.org/html/lircd.html
Default: '127.0.0.1'
Default: 8765
path to a unix domain socket
Pause in milliseconds before trying to reconnect to LIRC
Default: 5000
MIT © Sebastian Raff