diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts
index 85663de87d..6549558047 100644
--- a/src/panels/config/integrations/ha-integration-card.ts
+++ b/src/panels/config/integrations/ha-integration-card.ts
@@ -303,7 +303,7 @@ export class HaIntegrationCard extends LitElement {
>
-
+
${this.hass.localize(
"ui.panel.config.integrations.config_entry.rename"
)}
@@ -420,6 +420,15 @@ export class HaIntegrationCard extends LitElement {
showOptionsFlowDialog(this, ev.target.closest("ha-card").configEntry);
}
+ private _handleRename(ev: CustomEvent): void {
+ if (!shouldHandleRequestSelectedEvent(ev)) {
+ return;
+ }
+ this._editEntryName(
+ ((ev.target as HTMLElement).closest("ha-card") as any).configEntry
+ );
+ }
+
private _handleReload(ev: CustomEvent): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
@@ -578,8 +587,7 @@ export class HaIntegrationCard extends LitElement {
});
}
- private async _editEntryName(ev) {
- const configEntry = ev.target.closest("ha-card").configEntry;
+ private async _editEntryName(configEntry: ConfigEntry) {
const newName = await showPromptDialog(this, {
title: this.hass.localize("ui.panel.config.integrations.rename_dialog"),
defaultValue: configEntry.title,