acc.on('identify', (paired, callback) => { this.log('identify ' + this.id + ' ' + this.username + ' ' + paired); callback(); });
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; }
port: config.port, pincode: config.pincode, category: Accessory.Categories.TELEVISION });
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);
.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'); });