UNPKG

matterbridge-roborock-vacuum-plugin

Version:
33 lines 932 B
/** * Value object representing a vacuum clean mode. * Uses type-safe enumeration pattern with predefined instances. */ export class CleanMode { value; static Vacuum = new CleanMode('vacuum'); static Mop = new CleanMode('mop'); static VacuumAndMop = new CleanMode('vacuum_and_mop'); constructor(value) { this.value = value; } static fromString(mode) { const normalized = mode.toLowerCase().trim(); switch (normalized) { case 'vacuum': return CleanMode.Vacuum; case 'mop': return CleanMode.Mop; case 'vacuum_and_mop': return CleanMode.VacuumAndMop; default: return new CleanMode(normalized); } } toString() { return this.value; } equals(other) { return this.value === other.value; } } //# sourceMappingURL=CleanMode.js.map