Generate node firmware from YAML #120
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/yaml-nodes"
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?
A node can now be described in
nodes/*.yamland built withNODE=nodes/x.yaml pio run -e gen_xiao_c3|gen_xiao_s3|gen_lolin32. Endpoints react to other endpoints, local or on another node, through binds (toggle/follow) in the runtime, with a strategy per target endpoint type; amodebind on a button broadcastsSYS_MODE. Outputs and binds declare the modes that disable them withdisabled_modes. Settings (toggle,duration,percentage) are remembered across restarts and can gate an input's binds (enabled_by), tune an occupancyhold, a follow bind'son_delayandrun_time, or a dimmer'snight_brightness; each of those also takes a plain literal. Format and ID rules are innodes/README.md; spec section 4 reserves wire IDs 0–10, section 7 defines lights and fans by semantic class and lets a node hold a listed endpoint off for a mode's duration, and section 9.5 covers binds, follow timing, the night level and mode binds.nodes/node.schema.jsonis a JSON Schema generated from the generator's tables, for front ends; CI fails if it is stale.nodes/holds no node yet; test nodes live inscripts/tests/fixtures/.Types:
light,fan,load,dimmable_light,variable_fan,colour_light(WS2805 strip),switch,touch,occupancy,temperature,toggle,duration,percentage.Merges #117 (docs), #118 (runtime binds,
SwitchInput), #119 (generator), #121 (schema), #122 (script tests moved toscripts/tests/), #123 (sample node moved to the fixtures), #124 and #125 (output types; mode rules by semantic class), #126 (occupancy binds suppressed in modes, since replaced), #127 (pinslist on PWM outputs), #128 (strapping pins warn instead of failing), #129 (bind strategy per target type), #130 (disabled_modes), #131 (touch), #132 (colour_light), #134 (toggleanddurationsettings,enabled_by), #133 (followon_delayandrun_time), #135 (percentageandnight_brightness) and #136 (modebinds).Behaviour changes to existing code:
SwitchEndpointwrites its off level beforepinModeand takes an optionalinvert;modeSwitchesOffdecides by semantic class rather than endpoint type;Node::addBindreturns whether the bind was accepted;LevelEndpoint::requesttakes arememberflag, default true; theSYS_MODEhandler is nowNode::applyMode, so a node can set its own mode. No existing node's behaviour changes; the water heater's final pin level is unchanged.Tested in CI: native suite, the generator and schema unit tests, and a build of every test fixture on its board's env (C3, S3, LOLIN32). Not run on hardware; dimmer PWM resolution is calculated, not bench-checked.
YN-1 to YN-18.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.