genconfigschema

command
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL