-
-
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
Template lock new syntax #35243
base: next
Are you sure you want to change the base?
Template lock new syntax #35243
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe changes involve updates to the documentation for the Template Lock integration and the Template integration in Home Assistant. The Template Lock documentation has restructured the YAML configuration format, requiring users to nest lock definitions under a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HomeAssistant
participant TemplateLock
User->>HomeAssistant: Configure lock under template key
HomeAssistant->>TemplateLock: Process configuration
TemplateLock-->>HomeAssistant: Lock state, availability, and actions
HomeAssistant-->>User: Confirmation of configuration
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 (6)
source/_integrations/lock.template.markdown (4)
19-20
: LGTM! Helpful additions and clear example of new syntax.The changes in this section are well-structured and informative:
- The addition of the related document link for Template entities is helpful.
- The note about UI configuration not being available is crucial information for users.
- The updated configuration example clearly demonstrates the new syntax.
Consider adding a brief explanation of why UI configuration is not available for template locks, if possible. This could help users understand the limitation better.
Also applies to: 33-35, 43-54
60-97
: Configuration section updates look good, but consider clarifying the 'state' parameter.The changes in the configuration section accurately reflect the new structure and parameter names:
- The addition of
unique_id
is helpful for UI customization.- The renaming of parameters (e.g.,
value_template
tostate
) is consistent with the reported changes.- The new
availability
parameter provides useful functionality.Consider adding a note or example for the
state
parameter to clarify that it replaces the formervalue_template
. This could help users who are familiar with the old syntax understand the change better.🧰 Tools
🪛 LanguageTool
[misspelling] ~75-~75: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. re...(EN_COMPOUNDS_CASE_SENSITIVE)
Line range hint
119-204
: Examples section is comprehensive and well-updated.The examples section has been thoroughly updated and improved:
- All examples now use the new syntax, providing clear guidance for users.
- The range of examples (basic lock, optimistic mode, sensor with two switches) covers various use cases.
- The new example with dynamic code is an excellent addition, demonstrating an advanced scenario.
Consider adding a brief comment before each example to explain its specific use case or the concept it's demonstrating. This could help users quickly identify the most relevant example for their needs.
Line range hint
1-204
: Overall, excellent update to the Template Lock documentation.The document has been successfully updated to reflect the new template lock syntax:
- The structure is logical and easy to follow.
- All changes are consistent with the reported modifications.
- The language is clear and appropriate for the target audience.
- The examples are comprehensive and demonstrate various use cases.
Consider adding a "Breaking Changes" or "Migration Guide" section at the beginning of the document. This would help existing users understand how to update their configurations from the old syntax to the new one.
🧰 Tools
🪛 LanguageTool
[misspelling] ~75-~75: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. re...(EN_COMPOUNDS_CASE_SENSITIVE)
source/_integrations/template.markdown (2)
305-338
: Consider adding a brief example for lock configurationTo maintain consistency with other entity types in the documentation, consider adding a brief YAML example for the lock configuration. This would help users understand how to implement a template lock in their configuration. Here's a suggested example:
template: - lock: - name: "Template Lock" state: "{{ states('input_select.lock_status') }}" lock: service: script.lock_door unlock: service: script.unlock_doorAdding this example would align the lock documentation with other entity types and provide users with a quick reference for implementation.
🧰 Tools
🪛 LanguageTool
[misspelling] ~316-~316: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. ...(EN_COMPOUNDS_CASE_SENSITIVE)
Line range hint
1-24
: Update introduction to include locksTo ensure completeness and clarity, consider updating the introduction paragraph to explicitly mention locks as a supported entity type. This change would immediately inform users about the full range of entities supported by the Template integration.
Suggested update for the second paragraph:
Sensors, binary (on/off) sensors, buttons, images, locks, numbers, and selects are covered on this page. They can be configured using [UI](#configuration) or [YAML](#yaml-configuration) file.This minor change would help users quickly understand that locks are now supported by the Template integration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- source/_integrations/lock.template.markdown (6 hunks)
- source/_integrations/template.markdown (3 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/lock.template.markdown
[misspelling] ~75-~75: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. re...(EN_COMPOUNDS_CASE_SENSITIVE)
source/_integrations/template.markdown
[misspelling] ~316-~316: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. ...(EN_COMPOUNDS_CASE_SENSITIVE)
🔇 Additional comments (3)
source/_integrations/lock.template.markdown (1)
Line range hint
99-101
: Excellent addition of Template and action variables section.The new section on Template and action variables is a valuable addition to the documentation:
- It introduces the
this
variable, which is crucial for working with templates.- The explanation is concise and provides a link to more detailed documentation on self-referencing.
This information will be very helpful for users creating complex template locks.
🧰 Tools
🪛 LanguageTool
[misspelling] ~75-~75: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. re...(EN_COMPOUNDS_CASE_SENSITIVE)
source/_integrations/template.markdown (2)
305-338
: LGTM: Lock configuration added successfullyThe new lock configuration has been added to the Template integration documentation. The structure and content are consistent with other entity types in the document. Here's a summary of the changes:
- Lock entity type added to the configuration options.
- Proper indentation and formatting maintained.
- All required and optional fields for lock entities are documented.
- Descriptions for each field are clear and informative.
The addition of lock entities enhances the capabilities of the Template integration, providing users with more flexibility in their Home Assistant setups.
🧰 Tools
🪛 LanguageTool
[misspelling] ~316-~316: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. ...(EN_COMPOUNDS_CASE_SENSITIVE)
Line range hint
1-424
: Overall: Excellent addition of lock support to Template integrationThe changes to add lock support to the Template integration documentation are well-implemented and maintain the high quality of the existing documentation. The new lock configuration section is clear, consistent, and provides users with the necessary information to implement template locks in their Home Assistant setups.
A few minor suggestions have been made to further enhance the documentation:
- Adding a brief YAML example for lock configuration.
- Updating the introduction to explicitly mention locks as a supported entity type.
These suggestions are not critical but would improve the overall user experience and consistency of the documentation.
Great job on expanding the capabilities of the Template integration!
🧰 Tools
🪛 LanguageTool
[misspelling] ~316-~316: This word is normally spelled with a hyphen.
Context: ...e. Note that the string comparison not case sensitive;
"TrUe"and
"yEs"` are allowed. ...(EN_COMPOUNDS_CASE_SENSITIVE)
Proposed change
Template locks now support the new template entity syntax (which is also the default)
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
New Features
Documentation