UNPKG

homebridge-virtual-accessories

Version:
23 lines 746 B
/* eslint-disable curly */ import { Utils } from '../../utils/utils.js'; /** * */ export class BatteryConfiguration { isRechargeable = false; lowLevelThreshold; errorFields = []; fieldNames = Utils.proxiedPropertiesOf(this); isValid(prefix) { const isValidLowLevelThreshold = (Utils.required(this.lowLevelThreshold) && (this.lowLevelThreshold >= 5 && this.lowLevelThreshold <= 25)); // Store fields failing validation if (!isValidLowLevelThreshold) this.errorFields.push(prefix + '.' + this.fieldNames.lowLevelThreshold); return [ (isValidLowLevelThreshold), this.errorFields, ]; } } //# sourceMappingURL=configurationBattery.js.map