-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Add note on command template for binary sensor and sensor in command_line #35126
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe changes in the pull request focus on enhancing the documentation for the command line integration in Home Assistant. Key modifications include the addition of a note clarifying that the command name must be provided literally and cannot be generated by a template, while arguments can be templated. Minor formatting adjustments were made, alongside the introduction of new sections and YAML examples for various platforms, emphasizing correct context usage and integration with external scripts. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HomeAssistant
participant CommandLineIntegration
User->>HomeAssistant: Send command with template
HomeAssistant->>CommandLineIntegration: Process command
CommandLineIntegration-->>HomeAssistant: Validate command name
HomeAssistant-->>User: Return error if command name is not literal
CommandLineIntegration-->>HomeAssistant: Execute command with arguments
HomeAssistant-->>User: Return command result
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
🧹 Outside diff range and nitpick comments (2)
source/_integrations/command_line.markdown (2)
293-297
: Approved: Valuable clarification on command templating limitations.The added note provides crucial information about the limitations of templating in the
command
field forsensor
andbinary_sensor
platforms. This clarification will help users avoid potential configuration errors.Consider rephrasing the note slightly for improved clarity:
- While `command` is accepting a template for `sensor` and `binary_sensor`, it's only the arguments that can be a template. This means the command name itself cannot be generated by a template, but it must be literally provided. + While the `command` field accepts templates for `sensor` and `binary_sensor` platforms, only the arguments can be templated. The command name itself must be literally provided and cannot be generated by a template.
Line range hint
1-1000
: Suggestion: Add a table of contents for improved navigation.The documentation for the Command line integration is comprehensive and well-structured. To further enhance its usability, consider adding a table of contents at the beginning of the document. This would allow users to quickly navigate to specific sections of interest, especially given the length and depth of the documentation.
Here's a suggested format for the table of contents:
## Table of Contents - [Configuration](#configuration) - [Binary sensor](#binary-sensor) - [Cover](#cover) - [Notify](#notify) - [Sensor](#sensor) - [Switch](#switch) - [Execution](#execution) - [Examples](#examples) - [Binary sensor examples](#examples-binary-sensor-platform) - [Cover examples](#example-cover-platform) - [Sensor examples](#examples-sensor-platform) - [Switch examples](#example-switch-platform) - [Actions](#actions)This addition would improve the overall navigation and user experience of the documentation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- source/_integrations/command_line.markdown (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
source/_integrations/command_line.markdown (1)
Line range hint
1-1000
: Summary: Documentation improvements enhance clarity and usability.The changes to the Command line integration documentation, particularly the addition of the note about command templating limitations, provide valuable clarification for users. The existing content is comprehensive and well-structured, offering numerous examples across different platforms.
To further improve the documentation:
- Consider implementing the suggested rephrasing of the new note for enhanced clarity.
- Adding a table of contents would significantly improve navigation, especially given the document's length and depth.
Overall, these changes and suggestions will contribute to a better user experience and understanding of the Command line integration.
I would change the note - add this sentence like it was done for shell_command: Command line may be presented as
i.e. here the the whole 2nd command is templated, not only attributes. |
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.
Thanks, @gjohansson-ST 🙏
../Frenck
…line
Proposed change
Add additional note on
command
field limitation on templating forsensor
andbinary_sensor
incommand_line
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit