-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add template function: device_name #38476
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
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe changes update the templating documentation by introducing a new function, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TemplatingEngine as Engine
participant DeviceNameFunction as device_name
participant DeviceRegistry as Registry
User->>Engine: Submit template with device_name(lookup_value)
Engine->>device_name: Invoke device_name(lookup_value)
device_name->>Registry: Look up device details using lookup_value
Registry-->>device_name: Return device information
device_name-->>Engine: Return device name
Engine-->>User: Render template with device name
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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/_docs/configuration/templating.markdown (1)
430-431
: Improve Documentation Sentence Structure fordevice_name
The current description reads as two separate fragments. For improved clarity and consistency with similar entries, consider revising it to:- `device_name(lookup_value)` returns the device name for a given device ID or entity ID. Can also be used as a filter. + `device_name(lookup_value)` returns the device name for a given device ID or entity ID and can also be used as a filter.This change addresses the static analysis hint to include a complete sentence with a clear subject.
🧰 Tools
🪛 LanguageTool
[style] ~430-~430: To form a complete sentence, be sure to include a subject.
Context: ...ame for a given device ID or entity ID. Can also be used as a filter. #### Devices...(MISSING_IT_THERE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
source/_docs/configuration/templating.markdown
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_docs/configuration/templating.markdown
[style] ~430-~430: To form a complete sentence, be sure to include a subject.
Context: ...ame for a given device ID or entity ID. Can also be used as a filter. #### Devices...
(MISSING_IT_THERE)
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.
Thank you, @piitaya 👍
Proposed change
Add template function:
device_name
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit