How to use hap-node-client - 2 common examples

To help you get started, we’ve selected a few hap-node-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NorthernMan54 / homebridge-alexa / lib / alexaActions.js View on Github external
function hapDiscovery(options) {
  homebridge = new HAPNodeJSClient(options);

  homebridge.on('Ready', function() {
    alexaDiscovery.call(options, null, function() {
      // debug("Events", options);
      if (options.oldParser) {
        registerEvents(alexaTranslator.hapEndPoints());
      } else {
        registerEvents(hbDevices.toEvents());
      }
    });
  });

  homebridge.on('hapEvent', function(event) {
    // debug("Event Relay - 2", event);
    options.eventBus.emit('hapEvent', event);
  });
github NorthernMan54 / node-red-contrib-homebridge-automation / HAP-NodeRed.js View on Github external
function hbConf(n) {
    RED.nodes.createNode(this, n);
    this.username = n.username;
    this.password = this.credentials.password;

    this.users = {};

    if (!homebridge) {
      homebridge = new HAPNodeJSClient({
        "pin": n.username,
        "refresh": 900,
        "debug": true,
        "timeout": 20,
        "reqTimeout": 7000
      });
      reqisterQueue.pause();
      homebridge.on('Ready', function(accessories) {
        // evDevices = register.registerEv(homebridge, accessories);
        // ctDevices = register.registerCt(homebridge, accessories);
        hbDevices = new Homebridges(accessories);
        // debug("output", JSON.stringify(hbDevices.toList({ perms: 'ev'}), null, 4));
        // debug("evDevices", evDevices);
        // debug('Discovered %s evDevices', evDevices.length);
        debug('Discovered %s new evDevices', hbDevices.toList({
          perms: 'ev'

hap-node-client

Client for Hap-NodeJS

ISC
Latest version published 2 months ago

Package Health Score

70 / 100
Full package analysis

Popular hap-node-client functions

Similar packages