Fix schema validation errors in entity domain and light docs#6182
Fix schema validation errors in entity domain and light docs#6182jesserockz merged 2 commits intoesphome:currentfrom
Conversation
Templatable additions: - cover/index: Add [templatable] to stop, state, position, tilt in cover.control action - valve/index: Add [templatable] to stop, state, position in valve.control action - event/index: Add [templatable] to event_type in event.trigger action - update/index: Add [templatable] to force_update in update.perform action - speaker/index: Add [templatable] to data in speaker.play action - speaker/mixer: Fix plain "templatable" text to proper [templatable] link for decibel_reduction, duration - media_player/speaker: Add [templatable] to announcement, enqueue in play_on_device_media_file action Required/Optional fixes: - cover/current_based: open_obstacle_current_threshold, close_obstacle_current_threshold Required→Optional; close_action Optional→Required - cover/time_based: close_action Optional→Required - light/esp32_rmt_led_strip: chipset Required→Optional (not required when specifying manual timings) - light/neopixelbus: pin, clock_pin, data_pin Required→Optional (conditionally required based on chipset) - light/rp2040_pio_led_strip: chipset Required→Optional - light/status_led: pin Optional→Required Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughDocumentation updates across multiple ESPHome components to adjust configuration field requirements and add templatable annotations to various configuration options and fields. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Updates ESPHome documentation option metadata to match the underlying Python schemas, resolving schema validation errors in several entity-domain and light component docs.
Changes:
- Mark multiple automation/action options as
[templatable](/automations/templates)where the schema usescv.templatable(). - Correct Required vs Optional markers for several cover and light platform options to reflect their actual schema requirements.
- Normalize “templatable” text in speaker mixer docs to the standard
[templatable]link format.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/content/docs/components/valve/index.mdx | Add [templatable] markers to valve.control options (stop, state, position). |
| src/content/docs/components/update/index.mdx | Mark update.perform’s force_update as templatable. |
| src/content/docs/components/speaker/mixer.mdx | Replace plain “templatable” text with proper [templatable] links for action options. |
| src/content/docs/components/speaker/index.mdx | Mark speaker.play’s data as templatable. |
| src/content/docs/components/media_player/speaker.mdx | Mark announcement and enqueue as templatable for the play-on-device action. |
| src/content/docs/components/light/status_led.mdx | Correct pin to Required. |
| src/content/docs/components/light/rp2040_pio_led_strip.mdx | Correct chipset to Optional. |
| src/content/docs/components/light/neopixelbus.mdx | Correct pin / clock_pin / data_pin to Optional (conditionally required in practice). |
| src/content/docs/components/light/esp32_rmt_led_strip.mdx | Correct chipset to Optional (not required with manual timings). |
| src/content/docs/components/event/index.mdx | Mark event_type in event.trigger as templatable. |
| src/content/docs/components/cover/time_based.mdx | Correct close_action to Required. |
| src/content/docs/components/cover/index.mdx | Add templatable markers to cover.control options (stop, state, position, tilt). |
| src/content/docs/components/cover/current_based.mdx | Fix Required/Optional status for obstacle thresholds and make close_action Required. |
| - **pin** (**Required**, [Pin Schema](/guides/configuration-types#pin-schema)): The GPIO pin to control the LED on. | ||
| - **output** (*Optional*, [ID](/guides/configuration-types#id)): The id of the binary [Output Component](/components/output/) to use for this light. |
There was a problem hiding this comment.
One of pin or output are required. Maybe we need a new way to express these kind of validations?
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/content/docs/components/light/rp2040_pio_led_strip.mdx (1)
26-31: Consider adding clarifying text for when chipset is not required.For consistency with the
esp32_rmt_led_strip.mdxdocumentation, consider adding explanatory text indicating thatchipsetis not required when specifying manual timings. This helps users understand the conditional requirement.📝 Suggested documentation improvement
-- **chipset** (*Optional*, enum): The chipset to apply known timings from. +- **chipset** (*Optional*, enum): The name of the chipset used; determines signal timing. Not required if + specifying the [timings manually](`#manual-timings`).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/content/docs/components/light/rp2040_pio_led_strip.mdx` around lines 26 - 31, Add a short clarifying sentence to the description of the chipset option explaining that the chipset field is optional only when manual timings are provided; e.g., state that if users supply explicit timing values (manual timings) the chipset selection is not required, mirroring the guidance used in esp32_rmt_led_strip.mdx so readers understand the conditional requirement for chipset versus manual timings.src/content/docs/components/speaker/index.mdx (1)
143-146: Pre-existing RST-style note syntax should use GitHub-flavored alerts.The
.. note:syntax is RST format. Per coding guidelines, MDX files should use GitHub-flavored alert syntax.Suggested fix
-.. note: - -Between the time `speaker.is_playing` is false and `speaker.is_stopped` is true the 'speaker' component is closing down structures that where used to play the data correctly. *It better to check if the speaker is stopped then that if it plays.* +> [!NOTE] +> Between the time `speaker.is_playing` is false and `speaker.is_stopped` is true, the speaker component is closing down structures that were used to play the data correctly. *It is better to check if the speaker is stopped than if it plays.*As per coding guidelines: "Use GitHub-flavored alert syntax (
> [!NOTE],> [!WARNING],> [!TIP]) for alert boxes in MDX"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/content/docs/components/speaker/index.mdx` around lines 143 - 146, Replace the RST-style note starting with the literal ".. note:" (which contains the sentence about checking speaker.is_stopped vs speaker.is_playing and the explanation about closing down structures) with a GitHub-flavored alert using the blockquote alert syntax (e.g., start the block with "> [!NOTE]" followed by the same explanatory text), preserving the original wording about speaker.is_playing and speaker.is_stopped and any emphasis; ensure the alert uses MDX-compatible markdown rather than RST.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/content/docs/components/light/rp2040_pio_led_strip.mdx`:
- Around line 26-31: Add a short clarifying sentence to the description of the
chipset option explaining that the chipset field is optional only when manual
timings are provided; e.g., state that if users supply explicit timing values
(manual timings) the chipset selection is not required, mirroring the guidance
used in esp32_rmt_led_strip.mdx so readers understand the conditional
requirement for chipset versus manual timings.
In `@src/content/docs/components/speaker/index.mdx`:
- Around line 143-146: Replace the RST-style note starting with the literal "..
note:" (which contains the sentence about checking speaker.is_stopped vs
speaker.is_playing and the explanation about closing down structures) with a
GitHub-flavored alert using the blockquote alert syntax (e.g., start the block
with "> [!NOTE]" followed by the same explanatory text), preserving the original
wording about speaker.is_playing and speaker.is_stopped and any emphasis; ensure
the alert uses MDX-compatible markdown rather than RST.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
src/content/docs/components/cover/current_based.mdxsrc/content/docs/components/cover/index.mdxsrc/content/docs/components/cover/time_based.mdxsrc/content/docs/components/event/index.mdxsrc/content/docs/components/light/esp32_rmt_led_strip.mdxsrc/content/docs/components/light/neopixelbus.mdxsrc/content/docs/components/light/rp2040_pio_led_strip.mdxsrc/content/docs/components/media_player/speaker.mdxsrc/content/docs/components/speaker/index.mdxsrc/content/docs/components/speaker/mixer.mdxsrc/content/docs/components/update/index.mdxsrc/content/docs/components/valve/index.mdx
Summary
Templatable additions (verified against ESPHome Python source — all use
cv.templatable()):[templatable]tostop,state,position,tiltincover.controlaction[templatable]tostop,state,positioninvalve.controlaction[templatable]toevent_typeinevent.triggeraction[templatable]toforce_updateinupdate.performaction[templatable]todatainspeaker.playaction[templatable]link fordecibel_reduction,duration[templatable]toannouncement,enqueuein play actionRequired/Optional fixes (verified against ESPHome Python source):
open_obstacle_current_threshold,close_obstacle_current_thresholdRequired→Optional (cv.Optionalin schema);close_actionOptional→Required (cv.Requiredin schema)close_actionOptional→Required (cv.Requiredin schema)chipsetRequired→Optional (cv.Optional— not required when specifying manual timings)pin,clock_pin,data_pinRequired→Optional (cv.Optional— conditionally required based on chipset type)chipsetRequired→Optional (cv.Optionalin schema)pinOptional→Required (cv.Requiredin schema)Test plan
🤖 Generated with Claude Code