Pairing

UUID: 00000055-0000-1000-8000-0026BB765291

Required Characteristics

Example

Note

The example below is automatically generated and may not be a complete example of what is required to create a working "Pairing" Homebridge plugin.
// Example Pairing Plugin

module.exports = (api) => {
  api.registerAccessory('ExamplePairingPlugin', ExamplePairingAccessory);
};

class ExamplePairingAccessory {

  constructor(log, config, api) {
      this.log = log;
      this.config = config;
      this.api = api;

      this.Service = this.api.hap.Service;
      this.Characteristic = this.api.hap.Characteristic;

      // extract name from config
      this.name = config.name;

      // create a new Pairing service
      this.service = new this.Service(this.Service.Pairing);

      // create handlers for required characteristics
      this.service.getCharacteristic(this.Characteristic.PairingFeatures)
        .on('get', this.handlePairingFeaturesGet.bind(this));

  }

  /**
   * Handle requests to get the current value of the "Pairing Features" characteristic
   */
  handlePairingFeaturesGet(callback) {
    this.log.debug('Triggered GET PairingFeatures');

    // set this to a valid value for PairingFeatures
    const currentValue = 1;

    callback(null, currentValue);
  }


}