Tabnine Logo For Javascript
Accessory
Code IndexAdd Tabnine to your IDE (free)

How to use
Accessory
in
hap-nodejs

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

origin: rdmtc/RedMatic-HomeKit

acc.on('identify', (paired, callback) => {
        this.log('identify ' + this.id + ' ' + this.username + ' ' + paired);
        callback();
      });
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

  port: config.port,
  pincode: config.pincode,
  category: Accessory.Categories.TELEVISION
});
origin: rdmtc/RedMatic-HomeKit

  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);
origin: rdmtc/RedMatic-HomeKit

.once('listening', () => {
  testPort.once('close', () => {
    acc.publish({
      username: config.username,
      port: config.port,
      pincode: config.pincode,
      category: Accessory.Categories.CAMERA
    });
    acc._server.on('listening', () => {
      this.log('camera ' + this.name + ' listening on port ' + config.port);
      this.status({fill: 'green', shape: 'ring', text: ' '});
    });
    acc._server.on('pair', username => {
      this.log('camera ' + this.name + ' paired', username);
    });
    acc._server.on('unpair', username => {
      this.log('camera ' + this.name + ' unpaired', username);
    });
    acc._server.on('verify', () => {
      this.log('camera ' + this.name + ' verify');
    });
hap-nodejs(npm)Accessory

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

  • winston
    A logger for just about everything.
  • lodash
    Lodash modular utilities.
  • semver
    The semantic version parser used by npm.
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • async
    Higher-order functions and common patterns for asynchronous code
  • crypto
  • 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.
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • 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