Conversation
Updated JSON API documentation for palettes and custom options.
WalkthroughDocumentation for the JSON API expanded to cover palette behavior comprehensively. The segment object and info response schemas were clarified with firmware-dependent palette IDs and new palette-count fields. A dedicated Palettes section explains three palette types and ID scheme changes across WLED versions, with practical examples added for setting palettes on segments. ChangesPalette API Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/interfaces/json-api.md`:
- Around line 250-252: The three newly added table rows for cpalcount,
umpalcount, and umpalnames are missing the leading pipe character which breaks
GFM pipe-table formatting and triggers MD055; update the rows referenced by the
symbols cpalcount, umpalcount, and umpalnames to start with a leading '|' and
match the surrounding pipe-table format (also apply the same fix to the
analogous rows at the other occurrence mentioned around umpalcount/umpalnames at
the later section).
- Line 354: Change the subsection heading "Palette naming" to title case
("Palette Naming") in the docs/interfaces/json-api.md content so it matches the
project's documentation heading rules; locate the heading text "Palette naming"
and update its casing only (no other content changes).
- Line 199: The table row for the "pal" field is missing the leading pipe, which
breaks GFM pipe table style and triggers MD055; update the table row for the pal
entry (the line containing "pal | byte | ID of an available palette...") to
include the leading "|" at the start of the line so it conforms to standard
Markdown pipe-table syntax and passes linting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d0c3f320-7d9a-4263-8ade-9f4b64a1d157
📒 Files selected for processing (1)
docs/interfaces/json-api.md
| o2 | bool | Effect option 2. | ||
| o3 | bool | Effect option 3. | ||
| pal | 0 to info.palcount -1 | ID of the color palette or ~ to increment, ~- to decrement, or r for random. | ||
| pal | byte | ID of an available palette (see [Palettes](#palettes) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random. |
There was a problem hiding this comment.
Fix table row pipe style for the pal field entry.
This changed row is missing the leading |, which triggers MD055 and can fail docs linting.
Suggested fix
-pal | byte | ID of an available palette (see [Palettes](`#palettes`) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random.
+| pal | byte | ID of an available palette (see [Palettes](`#palettes`) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random.As per coding guidelines, use standard GFM pipe tables for Markdown documentation.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pal | byte | ID of an available palette (see [Palettes](#palettes) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random. | |
| | pal | byte | ID of an available palette (see [Palettes](`#palettes`) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random. |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 199-199: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe
(MD055, table-pipe-style)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/interfaces/json-api.md` at line 199, The table row for the "pal" field
is missing the leading pipe, which breaks GFM pipe table style and triggers
MD055; update the table row for the pal entry (the line containing "pal | byte |
ID of an available palette...") to include the leading "|" at the start of the
line so it conforms to standard Markdown pipe-table syntax and passes linting.
| cpalcount | byte | Number of custom user-created palettes. _(available since 0.11.0)_ | ||
| umpalcount | byte | Number of usermod-registered palettes. _(available since 16.0.0)_ | ||
| umpalnames | array of strings | Names of usermod-registered palettes. _(available since 16.0.0)_ |
There was a problem hiding this comment.
Normalize pipe-table formatting for the newly added rows.
The newly added table rows here also miss the leading |, causing the same MD055 warnings.
Suggested fix
-cpalcount | byte | Number of custom user-created palettes. _(available since 0.11.0)_
-umpalcount | byte | Number of usermod-registered palettes. _(available since 16.0.0)_
-umpalnames | array of strings | Names of usermod-registered palettes. _(available since 16.0.0)_
+| cpalcount | byte | Number of custom user-created palettes. _(available since 0.11.0)_
+| umpalcount | byte | Number of usermod-registered palettes. _(available since 16.0.0)_
+| umpalnames | array of strings | Names of usermod-registered palettes. _(available since 16.0.0)_
-Set palette 0 on segment 0 | `{"seg":[{"id":0,"pal":0}]}`
-Set a custom palette (ID 200) on segment 1 | `{"seg":[{"id":1,"pal":200}]}`
+| Set palette 0 on segment 0 | `{"seg":[{"id":0,"pal":0}]}`
+| Set a custom palette (ID 200) on segment 1 | `{"seg":[{"id":1,"pal":200}]}`As per coding guidelines, use standard GFM pipe tables for Markdown documentation.
Also applies to: 281-282
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 250-250: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe
(MD055, table-pipe-style)
[warning] 251-251: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe
(MD055, table-pipe-style)
[warning] 252-252: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe
(MD055, table-pipe-style)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/interfaces/json-api.md` around lines 250 - 252, The three newly added
table rows for cpalcount, umpalcount, and umpalnames are missing the leading
pipe character which breaks GFM pipe-table formatting and triggers MD055; update
the rows referenced by the symbols cpalcount, umpalcount, and umpalnames to
start with a leading '|' and match the surrounding pipe-table format (also apply
the same fix to the analogous rows at the other occurrence mentioned around
umpalcount/umpalnames at the later section).
There was a problem hiding this comment.
Pull request overview
Adds a new “Palettes” documentation section to the JSON API docs to explain palette types and the palette ID scheme differences across WLED versions, motivated by the palette ID breaking changes introduced in WLED 16.0.0.
Changes:
- Updates the segment
palparameter documentation to point readers to a new Palettes section. - Extends the Info object table with
cpalcount,umpalcount, andumpalnames. - Adds examples and a new “Palettes” section describing legacy vs. 16.0.0+ ID allocation and naming sources.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| o2 | bool | Effect option 2. | ||
| o3 | bool | Effect option 3. | ||
| pal | 0 to info.palcount -1 | ID of the color palette or ~ to increment, ~- to decrement, or r for random. | ||
| pal | byte | ID of an available palette (see [Palettes](#palettes) section for available ID ranges depending on firmware version) or ~ to increment, ~- to decrement, or r for random. |
| Select random effect on _all selected_ segments | `{"seg":{"fx":"r"}}` | ||
| Select random palette between 5 and 10 on segment 2 | `{"seg":[{"id":2,"pal":"5~10r"}]}` | ||
| Set palette 0 on segment 0 | `{"seg":[{"id":0,"pal":0}]}` | ||
| Set a custom palette (ID 200) on segment 1 | `{"seg":[{"id":1,"pal":200}]}` |
| palcount | uint16 | Number of palettes configured. | ||
| cpalcount | byte | Number of custom user-created palettes. _(available since 0.11.0)_ | ||
| umpalcount | byte | Number of usermod-registered palettes. _(available since 16.0.0)_ |
Updated palette ID range and clarified custom palette usage.
Adds detailed documentation about WLED palette ID schemes to address the breaking changes introduced in WLED 16.0.0 (issue #2056).
Changes:
cpalcount,umpalcount, andumpalnamesto Info object tablepalparameter to reference the new Palettes sectionRelated issue: wled/WLED#5542
Summary by CodeRabbit
Documentation