Refactor threshold trigger and condition docs into shared includes - #45719
Conversation
|
It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the |
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the “threshold” family of trigger and condition documentation by extracting duplicated UI/YAML explanation blocks into shared includes, and then applying those includes to the temperature and humidity trigger/condition pages.
Changes:
- Introduces reusable include partials for “crossed threshold” and “changed” triggers (UI steps + UI options + YAML options).
- Introduces reusable include partials for “threshold value” conditions (UI steps + UI options + YAML options).
- Updates the temperature and humidity trigger/condition pages to use the new shared includes.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| source/_triggers/temperature.crossed_threshold.markdown | Replaces duplicated UI/YAML option text with shared “crossed threshold” includes (temperature variant). |
| source/_triggers/temperature.changed.markdown | Replaces duplicated UI/YAML option text with shared “changed” includes (temperature variant). |
| source/_triggers/humidity.crossed_threshold.markdown | Replaces duplicated UI/YAML option text with shared “crossed threshold” includes (unitless/humidity variant). |
| source/_triggers/humidity.changed.markdown | Replaces duplicated UI/YAML option text with shared “changed” includes (unitless/humidity variant). |
| source/_conditions/temperature.is_value.markdown | Replaces duplicated UI/YAML option text with shared “threshold value” condition includes (temperature variant). |
| source/_conditions/humidity.is_value.markdown | Replaces duplicated UI/YAML option text with shared “threshold value” condition includes (unitless/humidity variant). |
| source/_includes/triggers/threshold_crossed_steps.md | New shared UI step list for “crossed threshold” triggers. |
| source/_includes/triggers/threshold_crossed_options_ui.md | New shared UI options block for “crossed threshold” triggers. |
| source/_includes/triggers/threshold_crossed_options_yaml.md | New shared YAML options block for “crossed threshold” triggers. |
| source/_includes/triggers/threshold_changed_steps.md | New shared UI step list for “changed” triggers. |
| source/_includes/triggers/threshold_changed_options_ui.md | New shared UI options block for “changed” triggers. |
| source/_includes/triggers/threshold_changed_options_yaml.md | New shared YAML options block for “changed” triggers. |
| source/_includes/conditions/threshold_value_steps.md | New shared UI step list for “threshold value” conditions. |
| source/_includes/conditions/threshold_value_options_ui.md | New shared UI options block for “threshold value” conditions. |
| source/_includes/conditions/threshold_value_options_yaml.md | New shared YAML options block for “threshold value” conditions. |
c0ffeeca7
left a comment
There was a problem hiding this comment.
Love it! ❤️ Added a question.
|
@c0ffeeca7 I've replaced the temperature-specific stuff with variables so it each trigger can have the proper descriptions and units. |
c0ffeeca7
left a comment
There was a problem hiding this comment.
LGTM, but best to wait for opinions
c0ffeeca7
left a comment
There was a problem hiding this comment.
A merge conflict appeared. Could you take a look?
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
c0ffeeca7
left a comment
There was a problem hiding this comment.
This is documenting functionality that has already been implemented in past releases. Shouldn't this PR be targeting the current branch?
232d169 to
e7670fc
Compare
| against the threshold-mapping schema. | ||
|
|
||
| Parameters: | ||
| reading quantity noun, e.g. "humidity" |
There was a problem hiding this comment.
| reading quantity noun, e.g. "humidity" | |
| reading Quantity noun. For example: "humidity". |
What do you mean by a quantity noun?
There was a problem hiding this comment.
its the noun of the reading. maybe "Reading type" would be better?
There was a problem hiding this comment.
I think we could just remove that variable. The text works without it. One less potential source of copy-paste errors.
That depends on whether there are still trigger/condition docs missing in |
| {% options_ui %} | ||
| Threshold type: | ||
| description: | | ||
| The {{ include.reading }} level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold. |
There was a problem hiding this comment.
| The {{ include.reading }} level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold. | |
| The level the entity has to meet for the condition to pass. **Above** and **Below** are exclusive: a reading equal to the threshold does not pass. **In range** is exclusive at both bounds. **Outside range** is inclusive: a reading equal to either bound passes. Choose **Number** to enter {{ include.value_short }}, or **Entity** to use a sensor or number helper as a dynamic threshold. |
maybe we can just remove this to make the text more generic.
Proposed change
Move duplicated parts of the threshold triggers/conditions into a set of shared includes.
Applied it to temperature and humidity. If the approach is approved, we can extend it later to others.
Type of change
currentbranch).currentbranch).nextbranch).nextbranch).Additional information
Checklist
currentbranch.nextbranch.