mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
20 lines
753 B
JavaScript
20 lines
753 B
JavaScript
module.exports = {
|
|
id: 'lift_down',
|
|
signature: 'lift_down()',
|
|
description: 'Move the lift downward.',
|
|
parameters: { type: 'object', properties: {}, additionalProperties: false },
|
|
availability(ctx = {}) {
|
|
const mode = String(ctx.mode || '');
|
|
if (mode === 'admin' || mode === 'lockdown') {
|
|
return { available: false, reason: `policy_lock:site_mode_${mode}` };
|
|
}
|
|
if (!ctx.liftState?.connected) return { available: false, reason: 'unavailable' };
|
|
if (ctx.liftState?.busy) return { available: false, reason: 'busy' };
|
|
return { available: true, reason: null };
|
|
},
|
|
async execute({ liftService, actor = 'overseerControl' }) {
|
|
const resp = await liftService.moveDown(actor);
|
|
return { ok: true, resp };
|
|
},
|
|
};
|