UNPKG

homebridge-boschcontrolpanel_bgseries

Version:
31 lines 1.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HKAccessory = void 0; const BGConst_1 = require("./BGConst"); const settings_1 = require("./settings"); class HKAccessory { constructor(platform, UUIDString, Name, Serial) { this.platform = platform; this.UUIDString = UUIDString; this.Name = Name; this.Serial = Serial; const uuid = platform.api.hap.uuid.generate(UUIDString); let accessory = platform.accessories.find(accessory => accessory.UUID === uuid); if (accessory) { this.platform.api.updatePlatformAccessories([accessory]); } else { accessory = new this.platform.api.platformAccessory(Name, uuid); this.platform.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]); } platform.CreatedAccessories.push(accessory); this.Accessory = accessory; this.Accessory.getService(this.platform.Service.AccessoryInformation) .setCharacteristic(this.platform.Characteristic.Manufacturer, 'Bosch Control Panel') .setCharacteristic(this.platform.Characteristic.Model, BGConst_1.BGPanelType[this.platform.Panel.PanelType]) .setCharacteristic(this.platform.Characteristic.SerialNumber, Serial) .setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.platform.Panel.FirmwareVersion.toSring()); } } exports.HKAccessory = HKAccessory; //# sourceMappingURL=HKAccessory.js.map