UNPKG

homebridge-plugin-eufy-security

Version:
41 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DoorbellPlatformAccessory = void 0; const new_streaming_delegate_1 = require("./new-streaming-delegate"); /** * Platform Accessory * An instance of this class is created for each accessory your platform registers * Each accessory may expose multiple services of different service types. */ class DoorbellPlatformAccessory { constructor(platform, accessory, device) { this.platform = platform; this.accessory = accessory; this.device = device; this.platform.log.debug('Constructed Doorbell'); // set accessory information this.accessory .getService(this.platform.Service.AccessoryInformation) .setCharacteristic(this.platform.Characteristic.Manufacturer, 'Eufy') .setCharacteristic(this.platform.Characteristic.Model, device.device_model) .setCharacteristic(this.platform.Characteristic.SerialNumber, device.device_sn); this.platform.log.debug('Device', device); this.service = this.accessory.getService(this.platform.Service.Doorbell) || this.accessory.addService(this.platform.Service.Doorbell); this.service.setCharacteristic(this.platform.Characteristic.Name, 'Test device'); this.service .getCharacteristic(this.platform.Characteristic.ProgrammableSwitchEvent) .on('get', this.handleProgrammableSwitchEventGet.bind(this)); this.service.setPrimaryService(true); // camera const delegate = new new_streaming_delegate_1.EufyCameraStreamingDelegate(this.platform, device); accessory.configureController(delegate.controller); // @todo Mute Mic, Mute Speaker, Volume, BatteryLevel, StatusLowBattery } handleProgrammableSwitchEventGet(callback) { callback(null, null); } } exports.DoorbellPlatformAccessory = DoorbellPlatformAccessory; //# sourceMappingURL=doorbell-platform-accessory.js.map