Let PWM outputs drive several pins with a pins list #127

Merged
Claude merged 2 commits from feat/yaml-pins-list into feat/yaml-nodes 2026-10-16 06:15:08 +00:00
Collaborator

YN-10. dimmable_light and variable_fan take either pin or pins (a list), never both. PwmConfig::pins already drives several pins on one LEDC channel, so there is no runtime change. Each list entry goes through the same parse_pin as a single pin (now taking the pin value rather than the raw endpoint), so a later change to the strapping rule lands in one place. Errors name the entry, e.g. endpoints[2].pins[1]: D0 is a strapping pin. An empty list, both fields, or neither are rejected, and the I2C clash with a temperature endpoint is checked per entry. Light, fan, load and the inputs stay single pin.

The schema allows pins on the two PWM types only, with exactly one of pin or pins and each entry limited to the board's output pins. README documents it. The LOLIN32 fixture's dimmable_light now uses pins: [17, 18], so CI compiles a multi-pin output.

Tested: Python 36 (was 30), none skipped locally; cutting the generated list to its first pin fails the render test. The three fixtures build and the generated array is {17, 18}. Nothing under lib/ or docs/ is touched.

YN-10. `dimmable_light` and `variable_fan` take either `pin` or `pins` (a list), never both. `PwmConfig::pins` already drives several pins on one LEDC channel, so there is no runtime change. Each list entry goes through the same `parse_pin` as a single `pin` (now taking the pin value rather than the raw endpoint), so a later change to the strapping rule lands in one place. Errors name the entry, e.g. `endpoints[2].pins[1]: D0 is a strapping pin`. An empty list, both fields, or neither are rejected, and the I2C clash with a temperature endpoint is checked per entry. Light, fan, load and the inputs stay single `pin`. The schema allows `pins` on the two PWM types only, with exactly one of `pin` or `pins` and each entry limited to the board's output pins. README documents it. The LOLIN32 fixture's `dimmable_light` now uses `pins: [17, 18]`, so CI compiles a multi-pin output. Tested: Python 36 (was 30), none skipped locally; cutting the generated list to its first pin fails the render test. The three fixtures build and the generated array is `{17, 18}`. Nothing under `lib/` or `docs/` is touched.
Let PWM outputs drive several pins with a pins list
Some checks failed
Build and test / release (pull_request) Has been cancelled
Build and test / build (pull_request) Has been cancelled
7dbebc445f
Claude left a comment

Two minor points, nothing blocking.

  • scripts/node_schema.py: pins has no uniqueItems, but the generator rejects a repeated pin ("already used"). Add "uniqueItems": True so the schema and generator agree.
  • scripts/yaml_node.py:199-200: pinFields is a parallel array zipped back with pins at line 258. Keep one list of (field, pin) pairs instead, or drop pinFields and rebuild the field names from endpoint["field"] at the one place that needs them.
Two minor points, nothing blocking. - scripts/node_schema.py: `pins` has no `uniqueItems`, but the generator rejects a repeated pin ("already used"). Add `"uniqueItems": True` so the schema and generator agree. - scripts/yaml_node.py:199-200: `pinFields` is a parallel array zipped back with `pins` at line 258. Keep one list of (field, pin) pairs instead, or drop `pinFields` and rebuild the field names from `endpoint["field"]` at the one place that needs them.
Require unique pins in the schema and drop the parallel field list
All checks were successful
Build and test / build (pull_request) Successful in 5m10s
Build and test / release (pull_request) Has been skipped
669d77a31c
rob requested changes 2026-10-15 19:10:27 +00:00
rob left a comment

Pins shouldn't be a pre-set list, it should just be an array of strings or ints

Pins shouldn't be a pre-set list, it should just be an array of strings or ints
Claude merged commit 7b3c71344a into feat/yaml-nodes 2026-10-16 06:15:08 +00:00
Sign in to join this conversation.
No reviewers
rob
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rob/CampervanControlSystems!127
No description provided.