Add a touch input type to YAML nodes #131
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/yaml-touch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
YN-13. New input type
touch(sensors::TouchInput, lib/touch) withpinand an optionalthreshold(z-score). It reports every 10 s like a switch, and binds treat it as a switch source, sotoggleworks;latchingis not accepted. The generator emits the GPIO number, not the D-name, sincetouchReadtakes a GPIO.The board table gains touch data. The S3 allows GPIO 1 to 14 (so
D0toD5, with the CAN pins still reserved) and takes the kitchen node's bench tuning: threshold 8.0 andsetTouchCycles(1000, 30). The LOLIN32 allows GPIO 0, 2, 4, 12, 13, 14, 15, 27, 32 and 33 on the library defaults. The C3 has no touch peripheral, sotouchis rejected there with a message naming the board. Tuning calls are emitted only where they differ from the library defaults, and<touch_input.h>is included only when a touch endpoint exists, so C3 builds never pull the touch library. Touch pins get the usual strapping warning.Schema regenerated: per-board touch pin lists,
touchrefused on the C3, and athresholdfield. README gains the type, a tuning note and touch as a bind source. The S3 and LOLIN32 fixtures each gain a touch endpoint with a toggle bind (LOLIN32 with a threshold override), so CI compiles both tunings.No runtime change was needed.
Tested: Python 55 (was 44), none skipped locally. Tests cover C3 rejection, non-touch pins, the S3 defaults, the LOLIN32 no-calls case, the threshold override, the strapping warning, and the schema; disabling the threshold call fails them. All three fixtures build, including
touch_input.hon the S3 and LOLIN32.Two minor points, nothing blocking.
.nanpasses<= 0and renderssetZScoreThreshold(nanf), which won't compile. Usenot threshold > 0(and reject.inf) so it fails in the generator.touchReportIntervalDsduplicatesoccupancyReportIntervalDs(both 100). Reuse one constant.