Files
machineGroupControl/src/commands/index.js
znetsixe 3ee1939b0a P11.5 + B2.1/B2.2: per-command units + description (where applicable)
Adds  to scalar setters whose payloads are
plain numbers OR {value, unit}. Skipped where payload is compound or
mode-dependent (control-%, {F, C: [...]}, etc.) — documented inline.
Every command gains a description field for wikiGen consumption.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:41:07 +02:00

43 lines
1.3 KiB
JavaScript

'use strict';
// machineGroupControl command registry. Consumed by BaseNodeAdapter via
// `static commands = require('./commands')`. Each descriptor maps a
// canonical msg.topic to its handler; legacy names are listed under
// `aliases` and emit a one-time deprecation warning at runtime.
const handlers = require('./handlers');
module.exports = [
{
topic: 'set.mode',
aliases: ['setMode'],
payloadSchema: { type: 'string' },
description: 'Switch the machine group between auto / manual modes.',
handler: handlers.setMode,
},
{
topic: 'set.scaling',
aliases: ['setScaling'],
payloadSchema: { type: 'string' },
description: 'Select the group scaling strategy.',
handler: handlers.setScaling,
},
{
topic: 'child.register',
aliases: ['registerChild'],
// payload is the Node-RED id (string) of the child node.
payloadSchema: { type: 'string' },
description: 'Register a child machine with this group.',
handler: handlers.registerChild,
},
{
topic: 'set.demand',
aliases: ['Qd'],
// any: number or numeric string — handler runs parseFloat.
payloadSchema: { type: 'any' },
units: { measure: 'volumeFlowRate', default: 'm3/h' },
description: 'Operator demand setpoint dispatched to the child machines.',
handler: handlers.setDemand,
},
];