-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
20240705.0 #21306
20240705.0 #21306
Conversation
* Fix automation picker overflow menu for keyboard * some updates from review * typing * no removeEventListener * updates from review
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Add auto-height option to resize editor * Use min instead of max * Remove auto height
Fix energy selection card in grid layout
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Simon Lamon <[email protected]> Co-authored-by: Franck Nijhof <[email protected]>
WalkthroughWalkthroughThe recent updates involve styling adjustments, the addition of new imports, property value changes, and the modification of text prompts in different components of the Lovelace UI. The changes also include the ability to set the Changes
Note: Sequence diagrams were not generated as the changes primarily involve styling, property adjustments, and text modifications, which do not significantly impact control flow or feature functions warranting such visualization. Recent review detailsConfiguration used: CodeRabbit UI Files ignored due to path filters (2)
Files selected for processing (27)
Additional context usedMarkdownlint
Biome
Additional comments not posted (56)
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: 10
@@ -3,13 +3,16 @@ title: When to use remove, delete, add and create | |||
subtitle: The difference between remove/delete and add/create. | |||
--- | |||
|
|||
# Remove vs Delete | |||
# Removing or deleting content |
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 multiple top-level headings in the same document.
Having multiple top-level headings violates markdown linting rule MD025. Consider using subheadings.
- # Removing or deleting content
+ ## Removing or deleting content
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.
# Removing or deleting content | |
## Removing or deleting content |
Tools
Markdownlint
6-6: null
Multiple top-level headings in the same document(MD025, single-title, single-h1)
const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | ||
.automation; |
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 and any
type.
Replace the non-null assertion with the optional chaining operator and specify a different type instead of any
.
- const automation = ((item.parentElement as HaMenu)!.anchorElement as any)!.automation;
+ const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation;
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 automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | |
.automation; | |
const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation; |
Tools
Biome
[error] 1076-1076: 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)
[error] 1076-1076: 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)
[error] 1076-1076: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | ||
.automation; |
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 and any
type.
Replace the non-null assertion with the optional chaining operator and specify a different type instead of any
.
- const automation = ((item.parentElement as HaMenu)!.anchorElement as any)!.automation;
+ const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation;
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 automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | |
.automation; | |
const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation; |
Tools
Biome
[error] 1066-1066: 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)
[error] 1066-1066: 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)
[error] 1066-1066: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | ||
.automation; |
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 and any
type.
Replace the non-null assertion with the optional chaining operator and specify a different type instead of any
.
- const automation = ((item.parentElement as HaMenu)!.anchorElement as any)!.automation;
+ const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation;
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 automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | |
.automation; | |
const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation; |
Tools
Biome
[error] 1083-1083: 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)
[error] 1083-1083: 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)
[error] 1083-1083: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | ||
.automation; |
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 and any
type.
Replace the non-null assertion with the optional chaining operator and specify a different type instead of any
.
- const automation = ((item.parentElement as HaMenu)!.anchorElement as any)!.automation;
+ const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation;
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 automation = ((item.parentElement as HaMenu)!.anchorElement as any)! | |
.automation; | |
const automation = ((item.parentElement as HaMenu)?.anchorElement as HTMLElement)?.automation; |
Tools
Biome
[error] 1060-1060: 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)
[error] 1060-1060: 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)
[error] 1060-1060: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
@@ -301,12 +301,13 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { | |||
private async _removeTag(selectedTag: Tag) { | |||
if ( | |||
!(await showConfirmationDialog(this, { | |||
title: this.hass!.localize("ui.panel.config.tag.confirm_remove_title"), | |||
text: this.hass.localize("ui.panel.config.tag.confirm_remove", { | |||
title: this.hass!.localize("ui.panel.config.tag.confirm_delete_title"), |
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.
Replace non-null assertion with optional chain operator.
The non-null assertion operator is unsafe. Replace it with the optional chain operator.
- title: this.hass!.localize("ui.panel.config.tag.confirm_delete_title"),
+ title: this.hass?.localize("ui.panel.config.tag.confirm_delete_title"),
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.
title: this.hass!.localize("ui.panel.config.tag.confirm_delete_title"), | |
title: this.hass?.localize("ui.panel.config.tag.confirm_delete_title"), |
Tools
Biome
[error] 304-304: 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)
title: this.hass!.localize("ui.panel.config.tag.confirm_remove_title"), | ||
text: this.hass.localize("ui.panel.config.tag.confirm_remove", { | ||
title: this.hass!.localize("ui.panel.config.tag.confirm_delete_title"), | ||
text: this.hass.localize("ui.panel.config.tag.confirm_delete", { | ||
tag: selectedTag.name || selectedTag.id, | ||
}), | ||
dismissText: this.hass!.localize("ui.common.cancel"), |
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.
Replace non-null assertion with optional chain operator.
The non-null assertion operator is unsafe. Replace it with the optional chain operator.
- dismissText: this.hass!.localize("ui.common.cancel"),
+ dismissText: this.hass?.localize("ui.common.cancel"),
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.
dismissText: this.hass!.localize("ui.common.cancel"), | |
dismissText: this.hass?.localize("ui.common.cancel"), |
Tools
Biome
[error] 308-308: 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)
tag: selectedTag.name || selectedTag.id, | ||
}), | ||
dismissText: this.hass!.localize("ui.common.cancel"), | ||
confirmText: this.hass!.localize("ui.common.remove"), | ||
confirmText: this.hass!.localize("ui.common.delete"), |
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.
Replace non-null assertion with optional chain operator.
The non-null assertion operator is unsafe. Replace it with the optional chain operator.
- confirmText: this.hass!.localize("ui.common.delete"),
+ confirmText: this.hass?.localize("ui.common.delete"),
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.
confirmText: this.hass!.localize("ui.common.delete"), | |
confirmText: this.hass?.localize("ui.common.delete"), |
Tools
Biome
[error] 309-309: 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)
: ""} | ||
<div class="header-right"> | ||
${battery && | ||
(batteryDomain === "binary_sensor" || !isNaN(battery.state as 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.
Specify a different type instead of using any
.
- (battery.state as any)
+ (battery.state as unknown as number)
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.
(batteryDomain === "binary_sensor" || !isNaN(battery.state as any)) | |
(batteryDomain === "binary_sensor" || !isNaN(battery.state as unknown as number)) |
Tools
Biome
[error] 689-689: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
.path=${deviceAction.icon} | ||
slot="graphic" | ||
></ha-svg-icon> | ||
` | ||
: ""} | ||
${deviceAction.trailingIcon | ||
? html` | ||
<ha-svg-icon | ||
slot="meta" | ||
.path=${deviceAction.trailingIcon} | ||
></ha-svg-icon> | ||
` | ||
: ""} | ||
</mwc-list-item>`; | ||
return deviceAction.href | ||
? html`<a | ||
href=${deviceAction.href} | ||
target=${ifDefined( | ||
deviceAction.target | ||
)} | ||
rel=${ifDefined( | ||
deviceAction.target | ||
? "noreferrer" | ||
: undefined | ||
)} | ||
>${listItem} | ||
</a>` | ||
: listItem; | ||
})} | ||
</ha-button-menu> | ||
` | ||
: ""} | ||
</div> | ||
` | ||
: "" | ||
} | ||
</ha-device-info-card> | ||
${!this.narrow ? [automationCard, sceneCard, scriptCard] : ""} | ||
</div> | ||
<div class="column"> | ||
${( | ||
[ | ||
"control", | ||
"sensor", | ||
"notify", | ||
"event", | ||
"assist", | ||
"config", | ||
"diagnostic", | ||
] as const | ||
).map((category) => | ||
// Make sure we render controls if no other cards will be rendered | ||
entitiesByCategory[category].length > 0 || | ||
(entities.length === 0 && category === "control") | ||
? html` | ||
<ha-device-entities-card | ||
.hass=${this.hass} | ||
.header=${this.hass.localize( | ||
`ui.panel.config.devices.entities.${category}` | ||
)} | ||
.deviceName=${deviceName} | ||
.entities=${entitiesByCategory[category]} | ||
.showHidden=${device.disabled_by !== null} | ||
> | ||
</ha-device-entities-card> | ||
` | ||
: "" | ||
)} | ||
<ha-device-via-devices-card | ||
.hass=${this.hass} | ||
.deviceId=${this.deviceId} | ||
></ha-device-via-devices-card> | ||
</div> | ||
<div class="column"> | ||
${this.narrow ? [automationCard, sceneCard, scriptCard] : ""} | ||
${ | ||
isComponentLoaded(this.hass, "logbook") | ||
? html` | ||
<ha-card outlined> | ||
<h1 class="card-header"> | ||
${this.hass.localize("panel.logbook")} | ||
</h1> | ||
<ha-logbook | ||
.hass=${this.hass} | ||
.time=${this._logbookTime} | ||
.entityIds=${this._entityIds(entities)} | ||
.deviceIds=${this._deviceIdInList(this.deviceId)} | ||
virtualize | ||
narrow | ||
no-icon | ||
></ha-logbook> | ||
</ha-card> | ||
` | ||
: "" | ||
} | ||
</div> | ||
</div> | ||
</ha-config-section> | ||
</hass-subpage> `; | ||
>${listItem} |
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.
Replace non-null assertions with optional chain operator ?.
.
The non-null assertions should be replaced with the optional chain operator ?.
for safer runtime checks.
- href=${ifDefined(firstDeviceAction!.href)}
+ href=${ifDefined(firstDeviceAction?.href)}
- rel=${ifDefined(firstDeviceAction!.target ? "noreferrer" : undefined)}
+ rel=${ifDefined(firstDeviceAction?.target ? "noreferrer" : undefined)}
- target=${ifDefined(firstDeviceAction!.target)}
+ target=${ifDefined(firstDeviceAction?.target)}
- class=${ifDefined(firstDeviceAction!.classes)}
+ class=${ifDefined(firstDeviceAction?.classes)}
- .action=${firstDeviceAction!.action}
+ .action=${firstDeviceAction?.action}
- ${firstDeviceAction!.label}
+ ${firstDeviceAction?.label}
- ${firstDeviceAction!.icon
+ ${firstDeviceAction?.icon
- class=${ifDefined(firstDeviceAction!.classes)}
+ class=${ifDefined(firstDeviceAction?.classes)}
- .path=${firstDeviceAction!.icon}
+ .path=${firstDeviceAction?.icon}
- ${firstDeviceAction!.trailingIcon
+ ${firstDeviceAction?.trailingIcon
- .path=${firstDeviceAction!.trailingIcon}
+ .path=${firstDeviceAction?.trailingIcon}
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.
href=${ifDefined(firstDeviceAction!.href)} | |
rel=${ifDefined( | |
firstDeviceAction!.target ? "noreferrer" : undefined | |
)} | |
</div> | |
` | |
: "" | |
} | |
<ha-device-info-card | |
.hass=${this.hass} | |
.device=${device} | |
> | |
${deviceInfo} | |
${ | |
firstDeviceAction || actions.length | |
? html` | |
<div class="card-actions" slot="actions"> | |
<div> | |
<a | |
href=${ifDefined(firstDeviceAction!.href)} | |
rel=${ifDefined( | |
firstDeviceAction!.target | |
? "noreferrer" | |
: undefined | |
)} | |
target=${ifDefined(firstDeviceAction!.target)} | |
> | |
<mwc-button | |
class=${ifDefined(firstDeviceAction!.classes)} | |
.action=${firstDeviceAction!.action} | |
target=${ifDefined(firstDeviceAction!.target)} | |
> | |
<mwc-button | |
class=${ifDefined(firstDeviceAction!.classes)} | |
.action=${firstDeviceAction!.action} | |
@click=${this._deviceActionClicked} | |
graphic="icon" | |
> | |
${firstDeviceAction!.label} | |
${firstDeviceAction!.icon | |
? html` | |
<ha-svg-icon | |
class=${ifDefined(firstDeviceAction!.classes)} | |
.path=${firstDeviceAction!.icon} | |
slot="graphic" | |
></ha-svg-icon> | |
` | |
: ""} | |
${firstDeviceAction!.trailingIcon | |
? html` | |
<ha-svg-icon | |
.path=${firstDeviceAction!.trailingIcon} | |
slot="trailingIcon" | |
></ha-svg-icon> | |
` | |
: ""} | |
</mwc-button> | |
</a> | |
</div> | |
${actions.length | |
? html` | |
<ha-button-menu> | |
<ha-icon-button | |
slot="trigger" | |
.label=${this.hass.localize("ui.common.menu")} | |
.path=${mdiDotsVertical} | |
></ha-icon-button> | |
${actions.map((deviceAction) => { | |
const listItem = html`<mwc-list-item | |
class=${ifDefined(deviceAction.classes)} | |
.action=${deviceAction.action} | |
@click=${this._deviceActionClicked} | |
graphic="icon" | |
.hasMeta=${Boolean(deviceAction.trailingIcon)} | |
> | |
${firstDeviceAction!.label} | |
${firstDeviceAction!.icon | |
${deviceAction.label} | |
${deviceAction.icon | |
? html` | |
<ha-svg-icon | |
class=${ifDefined( | |
firstDeviceAction!.classes | |
)} | |
.path=${firstDeviceAction!.icon} | |
class=${ifDefined(deviceAction.classes)} | |
.path=${deviceAction.icon} | |
slot="graphic" | |
></ha-svg-icon> | |
` | |
: ""} | |
${firstDeviceAction!.trailingIcon | |
${deviceAction.trailingIcon | |
? html` | |
<ha-svg-icon | |
.path=${firstDeviceAction!.trailingIcon} | |
slot="trailingIcon" | |
slot="meta" | |
.path=${deviceAction.trailingIcon} | |
></ha-svg-icon> | |
` | |
: ""} | |
</mwc-button> | |
</a> | |
</div> | |
${actions.length | |
? html` | |
<ha-button-menu> | |
<ha-icon-button | |
slot="trigger" | |
.label=${this.hass.localize( | |
"ui.common.menu" | |
</mwc-list-item>`; | |
return deviceAction.href | |
? html`<a | |
href=${deviceAction.href} | |
target=${ifDefined(deviceAction.target)} | |
rel=${ifDefined( | |
deviceAction.target | |
? "noreferrer" | |
: undefined | |
)} | |
.path=${mdiDotsVertical} | |
></ha-icon-button> | |
${actions.map((deviceAction) => { | |
const listItem = html`<mwc-list-item | |
class=${ifDefined(deviceAction.classes)} | |
.action=${deviceAction.action} | |
@click=${this._deviceActionClicked} | |
graphic="icon" | |
.hasMeta=${Boolean( | |
deviceAction.trailingIcon | |
)} | |
> | |
${deviceAction.label} | |
${deviceAction.icon | |
? html` | |
<ha-svg-icon | |
class=${ifDefined( | |
deviceAction.classes | |
)} | |
.path=${deviceAction.icon} | |
slot="graphic" | |
></ha-svg-icon> | |
` | |
: ""} | |
${deviceAction.trailingIcon | |
? html` | |
<ha-svg-icon | |
slot="meta" | |
.path=${deviceAction.trailingIcon} | |
></ha-svg-icon> | |
` | |
: ""} | |
</mwc-list-item>`; | |
return deviceAction.href | |
? html`<a | |
href=${deviceAction.href} | |
target=${ifDefined( | |
deviceAction.target | |
)} | |
rel=${ifDefined( | |
deviceAction.target | |
? "noreferrer" | |
: undefined | |
)} | |
>${listItem} | |
</a>` | |
: listItem; | |
})} | |
</ha-button-menu> | |
` | |
: ""} | |
</div> | |
` | |
: "" | |
} | |
</ha-device-info-card> | |
${!this.narrow ? [automationCard, sceneCard, scriptCard] : ""} | |
</div> | |
<div class="column"> | |
${( | |
[ | |
"control", | |
"sensor", | |
"notify", | |
"event", | |
"assist", | |
"config", | |
"diagnostic", | |
] as const | |
).map((category) => | |
// Make sure we render controls if no other cards will be rendered | |
entitiesByCategory[category].length > 0 || | |
(entities.length === 0 && category === "control") | |
? html` | |
<ha-device-entities-card | |
.hass=${this.hass} | |
.header=${this.hass.localize( | |
`ui.panel.config.devices.entities.${category}` | |
)} | |
.deviceName=${deviceName} | |
.entities=${entitiesByCategory[category]} | |
.showHidden=${device.disabled_by !== null} | |
> | |
</ha-device-entities-card> | |
` | |
: "" | |
)} | |
<ha-device-via-devices-card | |
.hass=${this.hass} | |
.deviceId=${this.deviceId} | |
></ha-device-via-devices-card> | |
</div> | |
<div class="column"> | |
${this.narrow ? [automationCard, sceneCard, scriptCard] : ""} | |
${ | |
isComponentLoaded(this.hass, "logbook") | |
? html` | |
<ha-card outlined> | |
<h1 class="card-header"> | |
${this.hass.localize("panel.logbook")} | |
</h1> | |
<ha-logbook | |
.hass=${this.hass} | |
.time=${this._logbookTime} | |
.entityIds=${this._entityIds(entities)} | |
.deviceIds=${this._deviceIdInList(this.deviceId)} | |
virtualize | |
narrow | |
no-icon | |
></ha-logbook> | |
</ha-card> | |
` | |
: "" | |
} | |
</div> | |
</div> | |
</ha-config-section> | |
</hass-subpage> `; | |
>${listItem} | |
href=${ifDefined(firstDeviceAction?.href)} | |
rel=${ifDefined( | |
firstDeviceAction?.target ? "noreferrer" : undefined | |
)} | |
target=${ifDefined(firstDeviceAction?.target)} | |
> | |
<mwc-button | |
class=${ifDefined(firstDeviceAction?.classes)} | |
.action=${firstDeviceAction?.action} | |
@click=${this._deviceActionClicked} | |
graphic="icon" | |
> | |
${firstDeviceAction?.label} | |
${firstDeviceAction?.icon | |
? html` | |
<ha-svg-icon | |
class=${ifDefined(firstDeviceAction?.classes)} | |
.path=${firstDeviceAction?.icon} | |
slot="graphic" | |
></ha-svg-icon> | |
` | |
: ""} | |
${firstDeviceAction?.trailingIcon | |
? html` | |
<ha-svg-icon | |
.path=${firstDeviceAction?.trailingIcon} | |
slot="trailingIcon" | |
></ha-svg-icon> | |
` | |
: ""} | |
</mwc-button> | |
</a> | |
</div> | |
${actions.length | |
? html` | |
<ha-button-menu> | |
<ha-icon-button | |
slot="trigger" | |
.label=${this.hass.localize("ui.common.menu")} | |
.path=${mdiDotsVertical} | |
></ha-icon-button> | |
${actions.map((deviceAction) => { | |
const listItem = html`<mwc-list-item | |
class=${ifDefined(deviceAction.classes)} | |
.action=${deviceAction.action} | |
@click=${this._deviceActionClicked} | |
graphic="icon" | |
.hasMeta=${Boolean(deviceAction.trailingIcon)} | |
> | |
${deviceAction.label} | |
${deviceAction.icon | |
? html` | |
<ha-svg-icon | |
class=${ifDefined(deviceAction.classes)} | |
.path=${deviceAction.icon} | |
slot="graphic" | |
></ha-svg-icon> | |
` | |
: ""} | |
${deviceAction.trailingIcon | |
? html` | |
<ha-svg-icon | |
slot="meta" | |
.path=${deviceAction.trailingIcon} | |
></ha-svg-icon> | |
` | |
: ""} | |
</mwc-list-item>`; | |
return deviceAction.href | |
? html`<a | |
href=${deviceAction.href} | |
target=${ifDefined(deviceAction.target)} | |
rel=${ifDefined( | |
deviceAction.target | |
? "noreferrer" | |
: undefined | |
)} | |
>${listItem} |
Tools
Biome
[error] 745-745: 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)
[error] 747-747: 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)
[error] 749-749: 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)
[error] 752-752: 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)
[error] 753-753: 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)
[error] 757-757: 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)
[error] 758-758: 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)
[error] 761-761: 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)
[error] 762-762: 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)
[error] 767-767: 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)
[error] 770-770: 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)
Summary by CodeRabbit
New Features
Bug Fixes
Localization