-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Take convert of blueprint automation and script #21151
Conversation
WalkthroughWalkthroughThese updates introduce new functions and configurations related to blueprint substitutions in multiple files across the system. They include importing necessary configurations, implementing blueprint substitution functions, and handling automation and script configurations within editors. Additionally, new translation keys were added to provide better user guidance for taking control of blueprints. Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional comments not posted (5)
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 8
Outside diff range comments (3)
src/panels/config/blueprint/blueprint-generic-editor.ts (1)
Line range hint
220-220
: Specify a more explicit type instead ofany
.Using
any
disables TypeScript's type checking, which can lead to potential bugs and less maintainable code. It's advisable to specify a more explicit type for better type safety.- const target = ev.target as any; + const target = ev.target as HTMLInputElement; // Assuming the target is an input element.src/panels/config/automation/ha-automation-editor.ts (2)
Line range hint
345-359
: Clarify the role of thedirty
andreadOnly
properties in context.The
dirty
andreadOnly
properties are used in multiple components. It's important to document these properties within the class to clarify their roles, especially how they interact with UI state and data handling.
Line range hint
449-458
: Refactor to improve readability and reduce complexity.The method handling the loading and normalization of automation config is complex and could be simplified. Consider breaking it down into smaller, more manageable methods.
- this._config = { - ...baseConfig, - ...(initData ? normalizeAutomationConfig(initData) : initData), - } as AutomationConfig; + this._initializeConfig(baseConfig, initData); private _initializeConfig(baseConfig: Partial<AutomationConfig>, initData?: Partial<AutomationConfig>) { this._config = { ...baseConfig, ...(initData ? normalizeAutomationConfig(initData) : initData), } as AutomationConfig; }
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: 3
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: 3
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.
✅
Proposed change
Adds the ability to convert a blueprint automation and script to a normal automation or script
Needs: home-assistant/core#119890
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
UI Enhancements
mdiFileEdit
) for better visual representation.Localization