xap

xAP Broadcast for Node.js =========================

npm install xap
1 downloads in the last week
5 downloads in the last month

xAP Broadcast for Node.js

How to Use

To install

  npm install xap

To Use

var xap = require('xap'),
    transmitter = new xap.XAPTransmitter(
        {class: 'test', source: 'testing', uid: 'FF123400'});

    transmitter.send('temp.current', {'temp': 25, 'units': 'C'});

You probably want to hook it up to something that generates messages more realistically, for example, to hook it up to my rfxcom library...

var RfxCom = require('rfxcom').RfxCom,
    xap = require('xap'),
    rfxcom = new RfxCom("/dev/ttyUSB0", {debug: true}),
    transmitter = new xap.XAPTransmitter(
      {class: 'Thermostat.status', source: 'rfxcom.WMR800.external', uid: 'FF123400'});

rfxcom.on("th3", function(evt) {
  transmitter.send('temp.current', {'temp': evt.temperature, 'units': 'C'});
});

rfxcom.initialise();
npm loves you