Skip to content

Remove LLM errors in the new templating syntax documentation#45095

Merged
frenck merged 2 commits into
home-assistant:currentfrom
etiennec78:remove-llm-error
Apr 29, 2026
Merged

Remove LLM errors in the new templating syntax documentation#45095
frenck merged 2 commits into
home-assistant:currentfrom
etiennec78:remove-llm-error

Conversation

@etiennec78
Copy link
Copy Markdown
Contributor

@etiennec78 etiennec78 commented Apr 29, 2026

Proposed change

The LLM gave an example about 10 / 10 | round vs (10 / 10) | round but both are equal to 1.
Then it also tried with 20 - 5 | round, with the same issue.
I removed these examples and only kept the one with 10 / 3, which is correct.

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 April 29, 2026 20:31
@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 rc This PR is against the RC branch labels Apr 29, 2026
@home-assistant
Copy link
Copy Markdown

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 Apr 29, 2026

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 7c2800c
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/69f26f0d5dd2bf00080b9940
😎 Deploy Preview https://deploy-preview-45095--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
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, for the pull request @etiennec78 👍

However, this is existing documentation; meaning this PR need to target and be based on the current branch.

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@home-assistant
Copy link
Copy Markdown

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 April 29, 2026 20:33
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

Updates the “new templating syntax” documentation to remove misleading operator-precedence examples and keep a single, correct illustration of how filters bind tighter than math operators.

Changes:

  • Replaced the non-demonstrating 10 / 10 | round(2) example with 10 / 3 | round(2) to actually show the precedence pitfall.
  • Removed the additional 20 - 5 | round(0) example that did not demonstrate the gotcha.

Comment thread source/_docs/templating/syntax.markdown Outdated
{% endexample %}

You might read that as "ten divided by ten, rounded to two decimals", which should be `1.0`. But because filters take priority, it actually runs as "ten divided by (ten rounded to two decimals)", which is `10 / 10.0 = 1.0`... Wait, that's also `1.0`. Let me try a clearer example:
You might read that as "ten divided by three, rounded to two decimals", which should be `3.33`. But because filters take priority, it actually runs as "ten divided by (three rounded to two decimals)", which is `10 / 3.0 = 3.3333333333333335`
@etiennec78 etiennec78 changed the base branch from rc to current April 29, 2026 20:35
@home-assistant home-assistant Bot removed needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch rc This PR is against the RC branch labels Apr 29, 2026
@home-assistant home-assistant Bot added the current This PR goes into the current branch label Apr 29, 2026
The LLM gave an example about `10 / 10 | round` vs `(10 / 10) | round` but both are equal to 1.
Then it also tried with `20 - 5 | round`, with the same issue.
I removed these examples and only kept the one with 10 / 3, which is correct.
Suggested by Copilot
@etiennec78
Copy link
Copy Markdown
Contributor Author

Yup, sorry about that, my "current" branch was out of sync and I couldn't find the right file 🤦
Everything should be good now 👍

@etiennec78 etiennec78 requested a review from frenck April 29, 2026 20:52
@frenck frenck marked this pull request as ready for review April 29, 2026 22:17
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @etiennec78 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck merged commit 0b05dd1 into home-assistant:current Apr 29, 2026
7 checks passed
@home-assistant home-assistant Bot removed the in-progress This PR/Issue is currently being worked on label Apr 29, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

current This PR goes into the current branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants