Use defined response_variable for json copy_to_clipboard button (#21705)

This commit is contained in:
karwosts 2024-08-15 21:40:56 -07:00 committed by GitHub
parent 3e1ea8d236
commit 16e84296da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -308,7 +308,7 @@ class HaPanelDevAction extends LitElement {
private async _copyTemplate(): Promise<void> {
await copyToClipboard(
`{% set action_response = ${JSON.stringify(this._response)} %}`
`{% set ${this._serviceData?.response_variable || "action_response"} = ${JSON.stringify(this._response)} %}`
);
showToast(this, {
message: this.hass.localize("ui.common.copied_clipboard"),