Compare commits

...

1 Commits

Author SHA1 Message Date
znetsixe
133d442b76 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:11 +02:00

View File

@@ -12,42 +12,52 @@ module.exports = [
topic: 'cmd.start', topic: 'cmd.start',
aliases: ['i_start'], aliases: ['i_start'],
payloadSchema: { type: 'any' }, payloadSchema: { type: 'any' },
description: 'Trigger / release the sampler start gate.',
handler: handlers.cmdStart, handler: handlers.cmdStart,
}, },
{ {
topic: 'set.schedule', topic: 'set.schedule',
aliases: ['monsternametijden'], aliases: ['monsternametijden'],
payloadSchema: { type: 'any' }, payloadSchema: { type: 'any' },
description: 'Replace the sampling-times schedule.',
handler: handlers.setSchedule, handler: handlers.setSchedule,
}, },
{ {
topic: 'set.rain', topic: 'set.rain',
aliases: ['rain_data'], aliases: ['rain_data'],
payloadSchema: { type: 'any' }, payloadSchema: { type: 'any' },
description: 'Push current rain-event data into the sampler logic.',
handler: handlers.setRain, handler: handlers.setRain,
}, },
{ {
topic: 'data.flow', topic: 'data.flow',
aliases: ['input_q'], aliases: ['input_q'],
payloadSchema: { type: 'object' }, payloadSchema: { type: 'object' },
// Compound payload `{value, unit}` — handler converts internally to m3/h.
// Registry-level normalisation is skipped (the handler reads payload.value /
// payload.unit directly; flattening would break it).
description: 'Push the upstream flow measurement (payload: {value, unit}).',
handler: handlers.dataFlow, handler: handlers.dataFlow,
}, },
{ {
topic: 'set.mode', topic: 'set.mode',
aliases: ['setMode'], aliases: ['setMode'],
payloadSchema: { type: 'any' }, payloadSchema: { type: 'any' },
description: 'Switch the monster between auto / manual modes.',
handler: handlers.setMode, handler: handlers.setMode,
}, },
{ {
topic: 'set.model-prediction', topic: 'set.model-prediction',
aliases: ['model_prediction'], aliases: ['model_prediction'],
payloadSchema: { type: 'any' }, payloadSchema: { type: 'any' },
description: 'Push the upstream rain-prediction snapshot used by the sampler.',
handler: handlers.setModelPrediction, handler: handlers.setModelPrediction,
}, },
{ {
topic: 'child.register', topic: 'child.register',
aliases: ['registerChild'], aliases: ['registerChild'],
payloadSchema: { type: 'string' }, payloadSchema: { type: 'string' },
description: 'Register a child node (typically a measurement) with this monster.',
handler: handlers.childRegister, handler: handlers.childRegister,
}, },
]; ];