Skip to content

Refactor threshold trigger and condition docs into shared includes#45719

Draft
abmantis wants to merge 2 commits into
nextfrom
threshold_triggers_conditions_reuse
Draft

Refactor threshold trigger and condition docs into shared includes#45719
abmantis wants to merge 2 commits into
nextfrom
threshold_triggers_conditions_reuse

Conversation

@abmantis
Copy link
Copy Markdown
Member

@abmantis abmantis commented Jun 2, 2026

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

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Copilot AI review requested due to automatic review settings June 2, 2026 22:20
@home-assistant home-assistant Bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Jun 2, 2026
@home-assistant
Copy link
Copy Markdown

home-assistant Bot commented Jun 2, 2026

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 205bf68
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/6a203dc42ca1f9000836737d
😎 Deploy Preview https://deploy-preview-45719--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Copy link
Copy Markdown
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 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.

Comment thread source/_includes/triggers/threshold_crossed_steps.md
Comment thread source/_includes/triggers/threshold_changed_steps.md
Comment thread source/_includes/conditions/threshold_value_steps.md
Copy link
Copy Markdown
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

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

Love it! ❤️ Added a question.

Comment thread source/_includes/triggers/threshold_changed_options_yaml.md Outdated
Comment thread source/_includes/triggers/threshold_changed_options_yaml.md Outdated
Comment thread source/_includes/triggers/threshold_changed_steps.md Outdated
Comment thread source/_includes/triggers/threshold_changed_steps.md Outdated
@abmantis
Copy link
Copy Markdown
Member Author

abmantis commented Jun 3, 2026

@c0ffeeca7 I've replaced the temperature-specific stuff with variables so it each trigger can have the proper descriptions and units.

@abmantis abmantis requested a review from c0ffeeca7 June 3, 2026 14:53
Copy link
Copy Markdown
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

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

LGTM, but best to wait for opinions

Copy link
Copy Markdown
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

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

A merge conflict appeared. Could you take a look?

@home-assistant
Copy link
Copy Markdown

home-assistant Bot commented Jun 5, 2026

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft June 5, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants