From 15b7414d4138f613a34bf0a6d4b046eae0f5f156 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Mon, 11 May 2026 17:41:19 +0200 Subject: [PATCH] P11.5 + B2.1/B2.2: per-command units + description (where applicable) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/commands/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index 83f491c..24c132b 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -14,27 +14,32 @@ module.exports = [ // Toggle — payload is ignored. `any` keeps the registry validator happy // for legacy callers that ship trigger payloads of various shapes. payloadSchema: { type: 'any' }, + description: 'Toggle the built-in simulator on / off.', handler: handlers.setSimulator, }, { topic: 'set.outlier-detection', aliases: ['outlierDetection'], payloadSchema: { type: 'any' }, + description: 'Toggle / configure outlier detection on the measurement pipeline.', handler: handlers.setOutlierDetection, }, { topic: 'cmd.calibrate', aliases: ['calibrate'], payloadSchema: { type: 'any' }, + description: 'Trigger a one-shot calibration of the measurement.', handler: handlers.calibrate, }, { topic: 'data.measurement', aliases: ['measurement'], - // Mode-dispatched: digital expects object, analog expects number/numeric - // string. The handler validates per-mode (the registry-level typeof - // check would reject one of the two valid shapes). + // Mode-dispatched: digital expects object (per-channel), analog expects + // number/numeric string in the configured Channel scaling units. Units + // are mode-dependent and resolved inside the handler — no registry-level + // `units` field. payloadSchema: { type: 'any' }, + description: 'Push a raw measurement (analog: number; digital: per-channel object).', handler: handlers.dataMeasurement, }, ];