Television Speaker
UUID: 00000113-0000-1000-8000-0026BB765291
Required Characteristics
Optional Characteristics
Example
The example below is automatically generated and may not be a complete example of what is required to create a working "Television Speaker" Homebridge plugin. Note
// Example Television Speaker Plugin module.exports = (api) => { api.registerAccessory('ExampleTelevisionSpeakerPlugin', ExampleTelevisionSpeakerAccessory); }; class ExampleTelevisionSpeakerAccessory { 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 Television Speaker service this.service = new this.Service(this.Service.TelevisionSpeaker); // create handlers for required characteristics this.service.getCharacteristic(this.Characteristic.Mute) .on('get', this.handleMuteGet.bind(this)) .on('set', this.handleMuteSet.bind(this)); } /** * Handle requests to get the current value of the "Mute" characteristic */ handleMuteGet(callback) { this.log.debug('Triggered GET Mute'); // set this to a valid value for Mute const currentValue = 1; callback(null, currentValue); } /** * Handle requests to set the "Mute" characteristic */ handleMuteSet(value, callback) { this.log.debug('Triggered SET Mute:' value); callback(null); } }