matterbridge-roborock-vacuum-plugin
Version:
Matterbridge Roborock Vacuum Plugin
30 lines • 1.36 kB
JavaScript
import { CommandNames } from '../../BehaviorDeviceGeneric.js';
export function registerCommonCommands(duid, handler, logger, roborockService, behaviorName, onActionTriggered) {
handler.setCommandHandler(CommandNames.SELECT_AREAS, async (newAreas) => {
logger.notice(`${behaviorName}-selectAreas: ${newAreas}`);
roborockService.setSelectedAreas(duid, newAreas ?? []);
});
handler.setCommandHandler(CommandNames.PAUSE, async () => {
logger.notice(`${behaviorName}-Pause`);
await roborockService.pauseClean(duid);
});
handler.setCommandHandler(CommandNames.RESUME, async () => {
logger.notice(`${behaviorName}-Resume`);
await roborockService.resumeClean(duid);
onActionTriggered();
});
handler.setCommandHandler(CommandNames.GO_HOME, async () => {
logger.notice(`${behaviorName}-GoHome`);
await roborockService.stopAndGoHome(duid);
onActionTriggered();
});
handler.setCommandHandler(CommandNames.IDENTIFY, async () => {
logger.notice(`${behaviorName}-identify`);
await roborockService.playSoundToLocate(duid);
});
handler.setCommandHandler(CommandNames.STOP, async () => {
logger.notice(`${behaviorName}-Stop`);
await roborockService.stopClean(duid);
});
}
//# sourceMappingURL=commonCommands.js.map