38 lines
1018 B
JavaScript
38 lines
1018 B
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' },
|
||
|
|
handler: handlers.setMode,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
topic: 'set.scaling',
|
||
|
|
aliases: ['setScaling'],
|
||
|
|
payloadSchema: { type: 'string' },
|
||
|
|
handler: handlers.setScaling,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
topic: 'child.register',
|
||
|
|
aliases: ['registerChild'],
|
||
|
|
// payload is the Node-RED id (string) of the child node.
|
||
|
|
payloadSchema: { type: 'string' },
|
||
|
|
handler: handlers.registerChild,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
topic: 'set.demand',
|
||
|
|
aliases: ['Qd'],
|
||
|
|
// any: number or numeric string — handler runs parseFloat.
|
||
|
|
payloadSchema: { type: 'any' },
|
||
|
|
handler: handlers.setDemand,
|
||
|
|
},
|
||
|
|
];
|