-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update template.markdown Legacy Binary Sensor #36542
Conversation
Example in Legacy binary sensor section was missing quote marks.
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe pull request introduces a minor modification to the YAML configuration documentation for the Home Assistant Changes
Sequence DiagramsequenceDiagram
participant Config as YAML Configuration
participant Template as Template Integration
participant Sun as Sun Entity
Config->>Template: Provide value_template
Template->>Sun: Request elevation attribute
Sun-->>Template: Return elevation value
Template->>Template: Evaluate condition (elevation > 0)
Template-->>Config: Determine binary sensor state
The sequence diagram illustrates how the template configuration retrieves the sun entity's elevation, evaluates the condition, and determines the binary sensor's state based on the elevation being greater than zero. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
source/_integrations/template.markdown (1)
942-942
: LGTM, but consider updating to modern format.While the added example is technically correct, it uses the legacy configuration format. Consider updating the documentation to show the modern configuration format instead:
- value_template: "{{ state_attr('sun.sun', 'elevation') > 0 }}"
Example using modern format:
template: - binary_sensor: - name: "Sun is up" state: "{{ state_attr('sun.sun', 'elevation') > 0 }}"
Proposed change
The example in the Legacy binary sensor section was missing quote marks, this PR simply adds quotes to surround the template.
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
New Features
Bug Fixes
value_template
to ensure proper string evaluation.