-
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
20240702.0 #21255
20240702.0 #21255
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* small improvements * Update ha-config-application-credentials.ts * Update ha-config-application-credentials.ts --------- Co-authored-by: Bram Kragten <[email protected]>
* Fix Webpack bundling of recorder worklet
* Hide demo card when showing demo from frontpage * Store in constant on load * reverse * Remove filter * move constnat * Make Home Assistant title
* Tweak first section in section demo * Allow automation entities be toggled
remove await logic
* Ignore aspect ratio in grid section * Feedback
* Change take control of blueprint UX * Add margin to ha-alert --------- Co-authored-by: Paul Bottein <[email protected]>
* Add min/max row/columns to resize card editor * Add humidifier and thermostat card * Removed unused condition * Don't set max rows * Add media card * Add button card * Use same rule if there is footer * Don't show disabled cell * Add min rows to sensor card * Update sizes * Update sizes * Update sizes * Add min rows to weather forecast card
Warning Rate limit exceeded@bramkragten has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 17 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent changes include multiple updates across various project components. Key modifications involve improved stream handling in translation processing, enhanced Webpack configurations for worker parsing, removal of Google Analytics scripts from several HTML templates, updates in Home Assistant demo configurations, additions to UI-related scripts, and significant refactoring in several entity and card classes in the project. These changes improve functionality, maintainability, and address specific user interface enhancements. Changes
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: 6
"text": "This automation is using a blueprint. By taking control, your automation will be converted into a regular automation using triggers, conditions and actions. You will be able to edit it directly and you won't be able to convert it back to a blueprint.", | ||
"action": "Take control" | ||
}, | ||
"confirm_take_control": "Your are viewing a preview of the automation config, do you want to take control?", |
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.
Fix typographical error in the translation key confirm_take_control
.
The word "Your" should be corrected to "You" in the translation string.
- "confirm_take_control": "Your are viewing a preview of the automation config, do you want to take control?",
+ "confirm_take_control": "You are viewing a preview of the automation config, do you want to take control?",
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"confirm_take_control": "Your are viewing a preview of the automation config, do you want to take control?", | |
"confirm_take_control": "You are viewing a preview of the automation config, do you want to take control?", |
"text": "This script is using a blueprint. By taking control, your script will be converted into a regular automation using actions. You will be able to edit it directly and you won't be able to convert it back to a blueprint.", | ||
"action": "[%key:ui::panel::config::automation::editor::take_control_confirmation::action%]" | ||
}, | ||
"confirm_take_control": "Your are viewing a preview of the script config, do you want to take control?", |
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.
Fix typographical error in the translation key confirm_take_control
.
The word "Your" should be corrected to "You" in the translation string.
- "confirm_take_control": "Your are viewing a preview of the script config, do you want to take control?",
+ "confirm_take_control": "You are viewing a preview of the script config, do you want to take control?",
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"confirm_take_control": "Your are viewing a preview of the script config, do you want to take control?", | |
"confirm_take_control": "You are viewing a preview of the script config, do you want to take control?", |
if (this._mode === "yaml") { | ||
this.renderRoot.querySelector("ha-yaml-editor")?.setValue(this._config); | ||
} | ||
this._readOnly = true; | ||
this._errors = undefined; | ||
} catch (err: any) { |
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.
Avoid using any
type.
Using any
disables type checking rules. Its use should be avoided. Replace any
with a more specific type.
- } catch (err: any) {
+ } catch (err: Error) {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
} catch (err: any) { | |
} catch (err: Error) { |
Tools
Biome
[error] 693-693: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
@@ -241,6 +245,15 @@ export class HuiEntityCard extends LitElement implements LovelaceCard { | |||
fireEvent(this, "hass-more-info", { entityId: this._config!.entity }); |
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.
Avoid using non-null assertion.
Replace the non-null assertion operator !
with the optional chaining operator ?.
for safer runtime checks.
- fireEvent(this, "hass-more-info", { entityId: this._config!.entity });
+ fireEvent(this, "hass-more-info", { entityId: this._config?.entity });
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
fireEvent(this, "hass-more-info", { entityId: this._config!.entity }); | |
fireEvent(this, "hass-more-info", { entityId: this._config?.entity }); |
Tools
Biome
[error] 245-245: Forbidden non-null assertion.
Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator
(lint/style/noNonNullAssertion)
const grid_columns = 2; | ||
let grid_rows = 1; | ||
if (this._config?.features?.length) { | ||
options.grid_rows += Math.ceil((this._config.features.length * 2) / 3); | ||
const featureHeight = Math.ceil((this._config.features.length * 2) / 3); | ||
grid_rows += featureHeight; | ||
} | ||
if (this._config?.vertical) { | ||
options.grid_rows++; | ||
grid_rows!++; | ||
} | ||
return options; | ||
return { | ||
grid_columns, | ||
grid_rows, | ||
grid_min_rows: grid_rows, | ||
grid_min_columns: grid_columns, | ||
}; |
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.
Fix: Remove non-null assertion.
Replace the non-null assertion with an optional chain operator to avoid potential runtime errors.
- if (this._config?.vertical) {
- grid_rows!++;
+ if (this._config?.vertical) {
+ grid_rows++;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const grid_columns = 2; | |
let grid_rows = 1; | |
if (this._config?.features?.length) { | |
options.grid_rows += Math.ceil((this._config.features.length * 2) / 3); | |
const featureHeight = Math.ceil((this._config.features.length * 2) / 3); | |
grid_rows += featureHeight; | |
} | |
if (this._config?.vertical) { | |
options.grid_rows++; | |
grid_rows!++; | |
} | |
return options; | |
return { | |
grid_columns, | |
grid_rows, | |
grid_min_rows: grid_rows, | |
grid_min_columns: grid_columns, | |
}; | |
const grid_columns = 2; | |
let grid_rows = 1; | |
if (this._config?.features?.length) { | |
const featureHeight = Math.ceil((this._config.features.length * 2) / 3); | |
grid_rows += featureHeight; | |
} | |
if (this._config?.vertical) { | |
grid_rows++; | |
} | |
return { | |
grid_columns, | |
grid_rows, | |
grid_min_rows: grid_rows, | |
grid_min_columns: grid_columns, | |
}; |
Tools
Biome
[error] 132-132: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
@@ -98,6 +100,7 @@ export class HuiCard extends ReactiveElement { | |||
if (this.hass) { | |||
this._element.hass = this.hass; | |||
} | |||
this._element.layout = this.layout; | |||
this._element.preview = this.preview; | |||
// For backwards compatibility | |||
(this._element as any).editMode = this.preview; |
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.
Avoid using any
type.
The use of any
disables many type checking rules. Consider specifying a different type.
- (this._element as any).editMode = this.preview;
+ (this._element as LovelaceCard & { editMode: boolean }).editMode = this.preview;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
(this._element as any).editMode = this.preview; | |
(this._element as LovelaceCard & { editMode: boolean }).editMode = this.preview; |
Tools
Biome
[error] 106-106: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
Summary by CodeRabbit
Bug Fixes
New Features
getLayoutOptions
method to various Lovelace cards for enhanced grid layout configurations.Dependencies
@material/web
to version1.5.1
.eslint-plugin-lit-a11y
to version4.1.3
.Refactor