congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo For Javascript
HAPNodeJS
Code IndexAdd Tabnine to your IDE (free)

How to use
HAPNodeJS
in
hap-nodejs

Best JavaScript code snippets using hap-nodejs.HAPNodeJS(Showing top 4 results out of 315)

origin: rdmtc/RedMatic-HomeKit

this.on('input', msg => {
          console.log(msg);
          this.debug('update ProgrammableSwitchEvent SINGLE_PRESS');
          doorbellService.getCharacteristic(hap.Characteristic.ProgrammableSwitchEvent).updateValue(0);
        });
origin: rdmtc/RedMatic-HomeKit

accessory(config) {
      const uuid = hap.uuid.generate(config.id + (config.uuidAddition ? config.uuidAddition : ''));
      let acc;

      this.bridge.bridgedAccessories.forEach(a => {
        if (a.UUID === uuid) {
          acc = a;
        }
      });

      if (acc) {
        this.debug('already existing accessory ' + config.id + ' ' + config.name);
      } else if (this.bridge.bridgedAccessories.length >= 150) {
        this.error('maximum of 150 accessories per bridge exceeded, can\'t add ' + config.id + ' ' + config.name);
      } else {
        this.debug('addAccessory ' + config.id + ' ' + config.name);
        acc = new hap.Accessory(config.name, uuid, hap.Accessory.Categories.OTHER);
        this.bridge.addBridgedAccessory(acc);
      }

      this.waitForAccessories();

      return acc;
    }
origin: rdmtc/RedMatic-HomeKit

  this.bridge = bridges[this.username];
} else {
  this.bridge = new hap.Bridge(this.name, hap.uuid.generate(this.username));
  bridges[this.username] = this.bridge;
origin: rdmtc/RedMatic-HomeKit

});
this.bridge.getService(hap.Service.AccessoryInformation)
  .setCharacteristic(hap.Characteristic.Manufacturer, 'RedMatic')
  .setCharacteristic(hap.Characteristic.Model, 'HAP-Nodejs Bridge')
  .setCharacteristic(hap.Characteristic.SerialNumber, this.username)
  .setCharacteristic(hap.Characteristic.FirmwareRevision, pkg.version);
        port: parseInt(this.port, 10),
        pincode: this.pincode,
        category: hap.Accessory.Categories.OTHER
      }, this.allowInsecureRequest);
      this.log('published bridge (' + this.bridge.bridgedAccessories.length + ' Accessories) ' + this.name + ' ' + this.username + ' on port ' + this.port);
hap-nodejs(npm)HAPNodeJS

Most used hap-nodejs functions

  • Accessory.Categories
  • Accessory._server
  • Accessory.on
  • Accessory.publish
  • CAMERA
  • Characteristic.ActiveIdentifier,
  • Characteristic.CONFIGURED,
  • Characteristic.ConfiguredName,
  • Characteristic.CurrentRelativeHumidity,
  • Characteristic.CurrentVisibilityState,
  • Characteristic.FirmwareRevision,
  • Characteristic.Identifier,
  • Characteristic.InputSourceType,
  • Characteristic.IsConfigured,
  • Characteristic.Manufacturer,
  • Characteristic.Model,
  • Characteristic.On,
  • Characteristic.PowerModeSelection,
  • Characteristic.ProgrammableSwitchEvent

Popular in JavaScript

  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • axios
    Promise based HTTP client for the browser and node.js
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • fs
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • mime-types
    The ultimate javascript content-type utility.
  • semver
    The semantic version parser used by npm.
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now