Compare commits

..

1 Commits

Author SHA1 Message Date
znetsixe
a57e0095a3 fix(commands+CONTRACT): correct set.mode mode list
- src/commands/index.js: description now lists the actual schema modes
  (`optimalControl`, `priorityControl`, `maintenance`); was generic
  "auto / manual" which never matched the schema.
- CONTRACT.md: same fix — old list included `dynamiccontrol` (doesn't
  exist) and used lowercase names that don't match the canonical
  schema enum.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:05:48 +02:00
2 changed files with 2 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ Hand-maintained for Phase 4; the `## Inputs` table is generated from
| Canonical | Aliases (deprecated) | Payload | Effect | | Canonical | Aliases (deprecated) | Payload | Effect |
|---|---|---|---| |---|---|---|---|
| `set.mode` | `setMode` | `string` — one of `prioritycontrol`, `optimalcontrol`, `dynamiccontrol`, … | Switches the control strategy via `source.setMode(payload)`. | | `set.mode` | `setMode` | `string` — one of `optimalControl`, `priorityControl`, `maintenance` (schema-validated) | Switches the control strategy via `source.setMode(payload)`. |
| `child.register` | `registerChild` | `string` — the child node's Node-RED id | Resolves the child via `RED.nodes.getNode` and registers it through `childRegistrationUtils.registerChild(childObj.source, msg.positionVsParent)`. | | `child.register` | `registerChild` | `string` — the child node's Node-RED id | Resolves the child via `RED.nodes.getNode` and registers it through `childRegistrationUtils.registerChild(childObj.source, msg.positionVsParent)`. |
| `set.demand` | `Qd` | numeric (number or numeric string) | Calls `source.handleInput('parent', parseFloat(payload))`. On success, replies on Port 0 with `topic = source.config.general.name`, `payload = 'done'`. Non-numeric payloads log `error` and are skipped. | | `set.demand` | `Qd` | numeric (number or numeric string) | Calls `source.handleInput('parent', parseFloat(payload))`. On success, replies on Port 0 with `topic = source.config.general.name`, `payload = 'done'`. Non-numeric payloads log `error` and are skipped. |

View File

@@ -12,7 +12,7 @@ module.exports = [
topic: 'set.mode', topic: 'set.mode',
aliases: ['setMode'], aliases: ['setMode'],
payloadSchema: { type: 'string' }, payloadSchema: { type: 'string' },
description: 'Switch the machine group between auto / manual modes.', description: 'Switch the operating mode. Allowed: `optimalControl`, `priorityControl`, `maintenance` (schema-validated in `machineGroupControl.json` → `mode.current`).',
handler: handlers.setMode, handler: handlers.setMode,
}, },
{ {