Nostalgic Primordial Monster
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

xap

0.1.3 • Public • Published

To Install

npm install xap

To Use

var xap = require('xap'),
    broadcaster = new xap.XAPBroadcaster(
        {class: 'test', source: 'vendor.device.testing', uid: 'FF123400'}
    );

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

xfx-viewer-shot

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

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

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

rfxcom.initialise();

Keywords

none

install

npm i xap

Downloadsweekly downloads

0

version

0.1.3

license

none

repository

githubgithub

last publish

collaborators

  • avatar
  • avatar