Repository navigation
added random playlist example in json-api.md - #276
Conversation
added random playlist example
|
Caution Review failedThe pull request is closed. WalkthroughDocumentation update adds a new JSON example in the Playlists section demonstrating configuration of an endless playlist with preset 12, random effect and palette selection, and segment brightness settings; includes instructions for uploading via ChangesPlaylists example
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5
Finishing Touches
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. 🐰✨ I hop through lines of JSON bright, Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/interfaces/json-api.md (1)
350-355: 💤 Low valueFormat the JSON example for readability/correct copy-paste.
The
"12"preset object (and nested"seg"fields) is currently very dense on one line, which increases the risk of accidental edits when users copy it (missing commas/quotes/brackets, etc.). Consider re-indenting the JSON to match the style used in earlier examples in this file.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/interfaces/json-api.md` around lines 350 - 355, Reformat the JSON example so the preset objects (especially the "12" preset and its nested "seg" array) are pretty-printed with proper indentation and line breaks like the earlier examples; expand the single-line object for "12" into multiple lines for each key (bri, mainseg, on, seg, transition, n) and likewise format the seg object fields (bri, c1/c2/c3, cct, col, frz, fx, grp, id, ix, m12, mi, o1/o2/o3, of, on, pal, rev, sel, set, si, spc, start, stop, sx, fxdef) so commas, brackets and quotes are clear and the "9" -> "playlist" structure remains readable for safe copy/paste.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/interfaces/json-api.md`:
- Around line 348-356: The example uses top-level numeric keys "9" (playlist
object with "playlist":{...}) and "12" (preset/preset segment under
"seg":{...}); add one short clarifying sentence below the JSON explaining that
those numeric keys are resource IDs (playlist ID 9 and preset ID 12), that
POSTing this payload to /json/cfg will persist/save both the playlist and
preset, and that to apply a playlist immediately you would instead POST an
appropriate state update to /json/state (or use the "playlist" command) —
reference the "9" playlist and "12" preset in the sentence so readers know which
parts are persisted vs applied.
- Around line 348-356: The sample playlist JSON includes an undocumented "r"
field inside the playlist object (the object keyed as "9" with
"playlist":{...}); either remove that "r" property from the example to match the
documented Playlist schema (which lists only ps, dur, transition, repeat, end),
or update the Playlist table above to add a clear entry for "r" (explaining its
type and semantics for playlists). Modify the sample under the
"AllRandomPlaylist" example or the Playlist object documentation accordingly so
the schema and example are consistent.
---
Nitpick comments:
In `@docs/interfaces/json-api.md`:
- Around line 350-355: Reformat the JSON example so the preset objects
(especially the "12" preset and its nested "seg" array) are pretty-printed with
proper indentation and line breaks like the earlier examples; expand the
single-line object for "12" into multiple lines for each key (bri, mainseg, on,
seg, transition, n) and likewise format the seg object fields (bri, c1/c2/c3,
cct, col, frz, fx, grp, id, ix, m12, mi, o1/o2/o3, of, on, pal, rev, sel, set,
si, spc, start, stop, sx, fxdef) so commas, brackets and quotes are clear and
the "9" -> "playlist" structure remains readable for safe copy/paste.
🪄 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: e7383106-b1af-4603-abdb-28b78eb0982d
📒 Files selected for processing (1)
docs/interfaces/json-api.md
Updated JSON example in documentation to clarify resource IDs and usage instructions.
AlexeyMal
left a comment
There was a problem hiding this comment.
resolved coderabbitai reported issues
This comment was marked as outdated.
This comment was marked as outdated.
Updated instructions for saving presets and activating playlists in the JSON API documentation.
|
Dear Frank, |
|
Hallo Alexey, I agree with what you say. Also this is a small addition, that should not require very long discussions. I've actually added the review bot in this repo to (incrementally) improve/harmonize writing style - the bot is still learning and no need to implement each of the requests it makes. Human judgement is still most important 😃. That's why we don't want the bot to re-write docs by itself - AI-written manuals are often unusable. For this PR, my main concern was to keep the example simple and do-able for average users. That why I interfered when seeing the suggestion to use JSON API requests - HA users might be used to that, but most users will not be able to follow. Just please confirm that the example works now (short test) and then I think we're ready to merge. Thanks for the contribution 👍 Frank. |
added random playlist example
Summary by CodeRabbit