[climate][water_heater] Document TemperatureUnit C++ API for custom components#6827
Open
jhenkens wants to merge 5 commits into
Open
[climate][water_heater] Document TemperatureUnit C++ API for custom components#6827jhenkens wants to merge 5 commits into
jhenkens wants to merge 5 commits into
Conversation
…omponents Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Documents the new TemperatureUnit enum and set_temperature_unit() C++ API for custom component authors so they can report Fahrenheit/Kelvin to Home Assistant via traits.
Changes:
- Added a “Custom C++ Components: Setting Temperature Unit” subsection to the Climate docs with a code example and available enum values.
- Added the same subsection to the Water Heater docs with a code example and available enum values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/content/docs/components/climate/index.mdx | Adds documentation and an example for setting temperature units on ClimateTraits (example currently needs adjustment to use traits() correctly). |
| src/content/docs/components/water_heater/index.mdx | Adds documentation and an example for setting temperature units on WaterHeaterTraits (example should use fully-qualified trait type). |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Documents the new
TemperatureUnitenum andset_temperature_unit()C++ API added toClimateTraitsandWaterHeaterTraits. This allows custom C++ component authors to declare that their device reports temperatures in Fahrenheit or Kelvin, and have that unit conveyed to Home Assistant via the ESPHome API.Adds a "Custom C++ Components: Setting Temperature Unit" subsection to both the Climate and Water Heater component docs, showing:
traits.set_temperature_unit(esphome::TemperatureUnit::FAHRENHEIT)in a custom componentTemperatureUnitenum values (CELSIUS,FAHRENHEIT,KELVIN)Related issue (if applicable): N/A
Pull request in esphome with YAML changes (if applicable):
Checklist
I am merging into
nextbecause this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
currentbecause this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/src/content/docs/components/index.mdxwhen creating new documents for new components or cookbook.