diff --git a/wiki/Reference-Contracts.md b/wiki/Reference-Contracts.md index c7ec8c5..36311c1 100644 --- a/wiki/Reference-Contracts.md +++ b/wiki/Reference-Contracts.md @@ -15,19 +15,19 @@ The registry lives in `src/commands/index.js`. Each descriptor maps a canonical `msg.topic` to its handler; aliases emit a one-time deprecation warning the first time they fire. - + | Canonical topic | Aliases | Payload | Unit | Effect | -|:---|:---|:---|:---|:---| -| `set.mode` | `setMode` | `string` (`auto` / `virtualControl` / `fysicalControl` / `maintenance`) | — | Switch operational mode via `source.setMode(payload)`. Each mode has its own allow-list of sources (`mode.allowedSources`). | -| `set.position` | `setpoint` | any | — | **No-op pending Phase 7.** Reserved for future per-valve positional override; the handler is debug-logged only. | -| `child.register` | `registerChild` | `string` (child node id) | — | Resolve via `RED.nodes.getNode`; if the child exposes `.source`, register through `childRegistrationUtils.registerChild(child.source, msg.positionVsParent)`. | -| `cmd.execSequence` | `execSequence` | `{ source, action, parameter }` | — | Forward to `source.handleInput(source, action, parameter)`. The `action` typically names a sequence; the parameter typically names the state list. | -| `data.totalFlow` | `totalFlowChange` | number, `{ value, position?, variant?, unit? }`, or `{ source, action, ... }` | `volumeFlowRate` (default `m3/h`) | Update total measured/predicted flow at the configured position; drives `calcValveFlows` to re-distribute. If `payload.source` is present, route via `handleInput(src, action, payload)`; otherwise treat as `parent`/`totalFlowChange`. | -| `cmd.emergencyStop` | `emergencyStop`, `emergencystop` | optional `{ source }` | — | Run the `emergencystop` sequence via `handleInput(src, 'emergencystop')`. Default source is `parent`. | -| `set.reconcileInterval` | `setReconcileInterval` | number — seconds (> 0) | seconds | Re-tune the periodic flow-reconciliation interval (`setReconcileIntervalSeconds`). Min clamp 100 ms. Non-finite or ≤ 0 logs a warn and is dropped. | +|---|---|---|---|---| +| `set.mode` | `setMode` | `string` | — | Switch the valve group between auto / manual control modes. | +| `set.position` | `setpoint` | any | — | Set the group-level valve position (currently a no-op pending Phase 7). | +| `child.register` | `registerChild` | `string` | — | Register a child valve with this group. | +| `cmd.execSequence` | `execSequence` | `object` | — | Run a group-wide sequence (startup / shutdown / emergencystop). | +| `data.totalFlow` | `totalFlowChange` | any | — | Notify the group that the total flow setpoint has changed. | +| `cmd.emergencyStop` | `emergencyStop`, `emergencystop` | any | — | Trigger an emergency stop across all valves in the group. | +| `set.reconcileInterval` | `setReconcileInterval` | any | — | Update the reconciliation interval (seconds). | - + ### Mode / source allow-lists