Documentation
¶
Overview ¶
Command genconfigschema generates, from a single JSON schema per Shelly script, both:
- the Go KVS-key maps and Default* constants that used to be hand-maintained (PoolKVSKeys) or regex-scraped from the .js source (tools/extract-pool-defaults, tools/extract-garden-defaults), and
- the CONFIG_SCHEMA (and, for garden.js, ZONE_KEY_SPECS) block injected in place into the .js file, between generated-block markers.
See GitHub issue #439.
Package main implements tools/genconfigschema: a generator that reads a single JSON schema file per Shelly script (e.g. pool-pump.schema.json) and produces both the JS CONFIG_SCHEMA (and, for garden.js, ZONE_KEY_SPECS) block(s) injected in place into the .js source, and the Go constants/KVS key maps that used to be hand-maintained or regex-scraped from the JS.
See GitHub issue #439 for the design rationale (Option A: JSON is the single source of truth; the JS schema block is generated from it, with `description` emitted as `//` comments so it never reaches the device).
Click to show internal directories.
Click to hide internal directories.