Skip to content

Fix type/templatable ordering in entity and template docs#6185

Merged
jesserockz merged 1 commit intoesphome:currentfrom
swoboda1337:fix/entity-templatable-batch
Mar 1, 2026
Merged

Fix type/templatable ordering in entity and template docs#6185
jesserockz merged 1 commit intoesphome:currentfrom
swoboda1337:fix/entity-templatable-batch

Conversation

@swoboda1337
Copy link
Member

Summary

  • Reorders (templatable, type) to (type, templatable) in 5 entity documentation files
  • The schema validator parses [templatable] as the type field when it appears before the actual type, causing false "should be templatable" errors
  • Convention is type, [templatable] (128 instances) vs [templatable], type (which these files used)

Files changed

  • cover/template.mdx — position, tilt, current_operation
  • valve/template.mdx — position, current_operation
  • water_heater/template.mdx — current_temperature, target_temperature, mode, away, is_on
  • light/index.mdx — initial_state.state
  • text_sensor/index.mdx — text_sensor.state condition

Test plan

  • Verify schema validation errors are resolved for these fields
  • Verify rendered docs are unchanged (just reordering within parentheses)

🤖 Generated with Claude Code

Reorder (templatable, type) to (type, templatable) so the schema
validator correctly parses the type field. Affected files:
- cover/template: position, tilt, current_operation
- valve/template: position, current_operation
- water_heater/template: current_temperature, target_temperature,
  mode, away, is_on
- light/index: initial_state.state
- text_sensor/index: text_sensor.state condition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 1, 2026 02:35
@esphome esphome bot added the current label Mar 1, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5dff81 and b928672.

📒 Files selected for processing (5)
  • src/content/docs/components/cover/template.mdx
  • src/content/docs/components/light/index.mdx
  • src/content/docs/components/text_sensor/index.mdx
  • src/content/docs/components/valve/template.mdx
  • src/content/docs/components/water_heater/template.mdx

Walkthrough

Type annotations are reordered in component documentation across five files, positioning primary types (float, string, boolean) before [templatable] annotations. No functional or behavioral changes introduced—purely documentation updates.

Changes

Cohort / File(s) Summary
Template Configuration Type Reorderings
src/content/docs/components/cover/template.mdx, src/content/docs/components/valve/template.mdx
Reordered type annotations in publish configuration options: position and current_operation parameters moved primary types (float, string) before [templatable] annotation.
Water Heater Template Configuration
src/content/docs/components/water_heater/template.mdx
Reordered type annotations for five publish options (current_temperature, target_temperature, mode, away, is_on), moving primary types before [templatable] annotation.
Component Documentation Type Reorderings
src/content/docs/components/light/index.mdx, src/content/docs/components/text_sensor/index.mdx
Reordered type annotations for state options, positioning primary types (boolean, string) before [templatable] annotation in documentation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

current

Suggested reviewers

  • glmnet
  • klejejs
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix type/templatable ordering in entity and template docs' accurately summarizes the main change—reordering type annotations in documentation files to follow the correct convention.
Description check ✅ Passed The description clearly explains the motivation (schema validator parsing issue), the changes across five files, and provides a test plan, all directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates several documentation option signatures to place the concrete type before the [templatable] marker, matching how the schema-doc tooling parses comma-separated type annotations in option parentheses.

Changes:

  • Reordered option annotations from (*Optional*, [templatable], type) to (*Optional*, type, [templatable]) in affected docs.
  • Normalized list item indentation for the updated option entries so they render as intended list items.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/content/docs/components/cover/template.mdx Reorders type/templatable for position, tilt, and current_operation in the publish action options.
src/content/docs/components/valve/template.mdx Reorders type/templatable for position and current_operation in the publish action options.
src/content/docs/components/water_heater/template.mdx Reorders type/templatable for several publish action options (current_temperature, target_temperature, mode, away, is_on).
src/content/docs/components/light/index.mdx Reorders type/templatable for initial_state.state.
src/content/docs/components/text_sensor/index.mdx Reorders type/templatable for text_sensor.state condition’s state field.

@netlify
Copy link

netlify bot commented Mar 1, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit b928672
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69a3a5fd5e9de70008055554
😎 Deploy Preview https://deploy-preview-6185--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jesserockz jesserockz merged commit 93ca6e5 into esphome:current Mar 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants