UNPKG

matterbridge-roborock-vacuum-plugin

Version:
30 lines 1.24 kB
import { debugStringify } from 'matterbridge/logger'; import { CleanModeDisplayLabel } from '../core/cleanModeConfig.js'; export class PresetCleanModeHandler { presetModes = [ CleanModeDisplayLabel.VacuumAndMopQuick, CleanModeDisplayLabel.VacuumAndMopMax, CleanModeDisplayLabel.VacuumAndMopMin, CleanModeDisplayLabel.VacuumAndMopQuiet, CleanModeDisplayLabel.VacuumAndMopDeep, CleanModeDisplayLabel.MopMax, CleanModeDisplayLabel.MopMin, CleanModeDisplayLabel.MopQuick, CleanModeDisplayLabel.MopDeep, CleanModeDisplayLabel.VacuumMax, CleanModeDisplayLabel.VacuumMin, CleanModeDisplayLabel.VacuumQuiet, CleanModeDisplayLabel.VacuumQuick, ]; canHandle(_mode, activity) { return this.presetModes.includes(activity); } async handle(duid, mode, activity, context) { const setting = context.cleanSettings[mode]; context.logger.notice(`${context.behaviorName}-ChangeCleanMode to: ${activity}, setting: ${debugStringify(setting ?? {})}`); if (setting) { await context.roborockService.changeCleanMode(duid, setting); } } } //# sourceMappingURL=presetCleanModeHandler.js.map