UNPKG

homebridge-virtual-accessories

Version:
26 lines 797 B
/* eslint-disable curly */ import { PowerState } from '../schema.js'; import { Utils } from '../../utils/utils.js'; /** * */ export class SwitchConfiguration { defaultState; hasResetTimer = false; hasCompanionSensor = false; muteLogging = false; errorFields = []; fieldNames = Utils.proxiedPropertiesOf(this); isValid(prefix) { const isValidDefaultState = (Utils.required(this.defaultState) && PowerState.States.includes(this.defaultState)); // Store fields failing validation if (!isValidDefaultState) this.errorFields.push(prefix + '.' + this.fieldNames.defaultState); return [ (isValidDefaultState), this.errorFields, ]; } } //# sourceMappingURL=configurationSwitch.js.map