homebridge-virtual-accessories
Version:
Virtual HomeKit accessories for Homebridge.
23 lines • 746 B
JavaScript
/* 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