UNPKG

matterbridge-roborock-vacuum-plugin

Version:
27 lines 1.37 kB
import { RvcCleanMode } from 'matterbridge/matter/clusters'; import { baseCleanModeConfigs, CleanModeDisplayLabel, CleanModeLabelInfo, getModeOptions, } from '../behaviors/roborock.vacuum/core/cleanModeConfig.js'; import { getAllModesForDevice } from '../behaviors/roborock.vacuum/core/deviceCapabilityRegistry.js'; const defaultModes = getModeOptions(baseCleanModeConfigs); export function getSupportedCleanModes(model, configManager) { if (configManager.forceRunAtDefault) { return getDefaultSupportedCleanModes(configManager, [...defaultModes]); } const supportedModes = getModeOptions(getAllModesForDevice(model)); return getDefaultSupportedCleanModes(configManager, supportedModes); } function getDefaultSupportedCleanModes(configManager, supportedModes) { // Add vacation mode if enabled if (configManager.useVacationModeToSendVacuumToDock) { supportedModes.push({ mode: CleanModeLabelInfo[CleanModeDisplayLabel.GoVacation].mode, label: CleanModeLabelInfo[CleanModeDisplayLabel.GoVacation].label, modeTags: [ { value: RvcCleanMode.ModeTag.Mop }, { value: RvcCleanMode.ModeTag.Vacuum }, { value: RvcCleanMode.ModeTag.Vacation }, ], }); } return supportedModes; } //# sourceMappingURL=getSupportedCleanModes.js.map