From 47715a8910eb82962aa249a6fbe32c074f8eebf2 Mon Sep 17 00:00:00 2001 From: hanwg Date: Tue, 7 Oct 2025 12:07:42 +0000 Subject: [PATCH 1/2] add menu item to copy config entry id --- .../integrations/ha-config-entry-row.ts | 19 +++++++++++++++++++ src/translations/en.json | 1 + 2 files changed, 20 insertions(+) diff --git a/src/panels/config/integrations/ha-config-entry-row.ts b/src/panels/config/integrations/ha-config-entry-row.ts index cffa113c3e38..c67f857d6b54 100644 --- a/src/panels/config/integrations/ha-config-entry-row.ts +++ b/src/panels/config/integrations/ha-config-entry-row.ts @@ -2,6 +2,7 @@ import { mdiAlertCircle, mdiChevronDown, mdiCogOutline, + mdiContentCopy, mdiDelete, mdiDevices, mdiDotsVertical, @@ -71,6 +72,8 @@ import { import "./ha-config-entry-device-row"; import { renderConfigEntryError } from "./ha-config-integration-page"; import "./ha-config-sub-entry-row"; +import { copyToClipboard } from "../../../common/util/copy-clipboard"; +import { showToast } from "../../../util/toast"; @customElement("ha-config-entry-row") class HaConfigEntryRow extends LitElement { @@ -308,6 +311,13 @@ class HaConfigEntryRow extends LitElement { ` : nothing} + + + ${this.hass.localize( + "ui.panel.config.integrations.config_entry.copy" + )} + + ${this.hass.localize( @@ -623,6 +633,15 @@ class HaConfigEntryRow extends LitElement { }); } + private async _handleCopy() { + await copyToClipboard(this.entry.entry_id); + showToast(this, { + message: + this.hass?.localize("ui.common.copied_clipboard") || + "Copied to clipboard", + }); + } + private async _handleRename() { const newName = await showPromptDialog(this, { title: this.hass.localize("ui.panel.config.integrations.rename_dialog"), diff --git a/src/translations/en.json b/src/translations/en.json index 302c3efe04ff..0d82cd0f8707 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5514,6 +5514,7 @@ "entries": "{count} {count, plural,\n one {entry}\n other {entries}\n}", "no_devices_or_entities": "No devices or entities", "devices_without_subentry": "Devices that don't belong to a sub-entry", + "copy": "Copy config entry ID", "rename": "Rename", "configure": "Configure", "system_options": "System options", From ac794e4cbc9f56e82bf5cd86c615dba51529dfa0 Mon Sep 17 00:00:00 2001 From: hanwg Date: Tue, 14 Oct 2025 10:14:12 +0000 Subject: [PATCH 2/2] update ui --- .../config/integrations/ha-config-entry-row.ts | 12 ++++++------ src/translations/en.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/panels/config/integrations/ha-config-entry-row.ts b/src/panels/config/integrations/ha-config-entry-row.ts index c67f857d6b54..179dc244ca93 100644 --- a/src/panels/config/integrations/ha-config-entry-row.ts +++ b/src/panels/config/integrations/ha-config-entry-row.ts @@ -311,17 +311,17 @@ class HaConfigEntryRow extends LitElement { ` : nothing} - - + + ${this.hass.localize( - "ui.panel.config.integrations.config_entry.copy" + "ui.panel.config.integrations.config_entry.rename" )} - - + + ${this.hass.localize( - "ui.panel.config.integrations.config_entry.rename" + "ui.panel.config.integrations.config_entry.copy" )} diff --git a/src/translations/en.json b/src/translations/en.json index 0d82cd0f8707..c8b38113fdb5 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5514,7 +5514,7 @@ "entries": "{count} {count, plural,\n one {entry}\n other {entries}\n}", "no_devices_or_entities": "No devices or entities", "devices_without_subentry": "Devices that don't belong to a sub-entry", - "copy": "Copy config entry ID", + "copy": "Copy entry ID", "rename": "Rename", "configure": "Configure", "system_options": "System options",