-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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 services docs for image entity #31327
Conversation
Looks like something that should be added to the docs. |
📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 WalkthroughWalkthroughThe changes introduce a new section titled "Services" in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ImageIntegration
participant Configuration
User->>ImageIntegration: Request snapshot service
ImageIntegration->>User: Provide required attributes (entity_id, filename)
User->>Configuration: Ensure filename is in allowlist_external_dirs
Configuration-->>User: Confirm filename is allowed
User->>ImageIntegration: Call snapshot service with attributes
ImageIntegration-->>User: Return snapshot 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/image.markdown (2)
24-31
: Consider clarifying the "Optional" column in the tableThe content and structure of this section are excellent. However, to enhance clarity, consider replacing "no" with "Required" in the "Optional" column of the table. This change would make it immediately clear that both attributes are mandatory.
For example:
| Service data attribute | Optional | Description | | ---------------------- | -------- | ----------- | | `entity_id` | Required | Name(s) of entities to create a snapshot from, e.g., `image.my_image`. | | `filename` | Required | Template of a file name. Variable is `entity_id`, e.g., {% raw %}`/tmp/snapshot_{{ entity_id.name }}`{% endraw %}. |
38-48
: LGTM: Excellent YAML example with a suggestionThe YAML example is well-formatted and effectively demonstrates how to use the
snapshot
service in an automation. The use of Liquid templating for the filename is a great way to show dynamic naming capabilities.Suggestion: Consider adding a brief comment explaining the Liquid templating used in the filename. This could help users who are less familiar with Liquid syntax. For example:
action: service: image.snapshot target: entity_id: image.yourimage data: # Uses Liquid templating to create a filename with the current date and time filename: '/tmp/yourimage_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'This addition would further enhance the educational value of the example.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- source/_integrations/image.markdown (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
source/_integrations/image.markdown (3)
17-22
: LGTM: Clear introduction to the Services sectionThe new section is well-structured and provides a concise introduction to the image platform services. It clearly states the available service (
snapshot
), which aligns with the PR objectives.
33-34
: LGTM: Important configuration noteThis note provides crucial information about the
filename
path requirements and correctly references theallowlist_external_dirs
configuration. The link to the configuration documentation is helpful for users who need more information.
35-37
: LGTM: Clear introduction to the exampleThis introduction effectively sets up the YAML example that follows. It clearly explains the purpose of the example (taking a snapshot and saving it with a timestamped filename), which helps users understand how to apply the
snapshot
service in their own automations.
0ebf909
to
e34dd2a
Compare
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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!
I had some comments on the core PR after merge, which would be good to address in a new PR.
Proposed change
Adds documentation for the new image.snapshot service
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
snapshot
service, allowing users to take a snapshot from an image.snapshot
service, includingentity_id
andfilename
.snapshot
service in automation.