UNPKG

@homebridge-plugins/homebridge-smarthq

Version:

The SmartHQ plugin allows you to interact with SmartHQ Devices in HomeKit and with Siri.

43 lines 1.76 kB
import { OpalDeviceBase } from '../OpalDeviceBase.js'; export class OpalMetadataSvcManager extends OpalDeviceBase { service; configuredName = 'Metadata'; opalIceMaker; constructor(opalIceMaker, platform, accessory, device) { super(platform, accessory, device); this.opalIceMaker = opalIceMaker; this.service = this.createService(); } createService() { // Check if service already exists const service = this.accessory.getService(''); service .getCharacteristic(this.platform.Characteristic.ConfiguredName) .onGet(() => this.configuredName) .setValue(this.configuredName); const fullQueryStr = [ this.opalIceMaker.schedulingManager.advancedOptionQueryStrs, this.opalIceMaker.powerManager.advancedOptionQueryStrs, this.opalIceMaker.progressManager?.advancedOptionQueryStrs || [], this.opalIceMaker.statusManager.iceBucketStatusManager.advancedOptionQueryStrs, this.opalIceMaker.statusManager.addWaterStatusManager.advancedOptionQueryStrs, this.opalIceMaker.filterMaintenanceManager.advancedOptionQueryStrs, this.opalIceMaker.descaleManager.advancedOptionQueryStrs, ] .reduce((acc, qs, index) => { if (index === 0) { return acc.concat(qs); } return acc.concat(qs); }, []).join(','); service .getCharacteristic(this.platform.Characteristic.ProductData) .onGet(() => fullQueryStr) .updateValue(fullQueryStr); return service; } getService() { return this.service; } } //# sourceMappingURL=OpalMetadataSvcManager.js.map