Fix migration from call-service to perform-action (#21746)

This commit is contained in:
Paul Bottein 2024-08-21 20:13:09 +02:00 committed by GitHub
parent 77d8aff1f4
commit 968c0de141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -226,8 +226,15 @@ export class HuiActionEditor extends LitElement {
if (!this.hass) {
return;
}
let action = this.config?.action;
if (action === "call-service") {
action = "perform-action";
}
const value = ev.target.value;
if (this.config?.action === value) {
if (action === value) {
return;
}
if (value === "default") {
@ -292,6 +299,7 @@ export class HuiActionEditor extends LitElement {
ev.stopPropagation();
const value = {
...this.config!,
action: "perform-action",
perform_action: ev.detail.value.action || "",
data: ev.detail.value.data,
target: ev.detail.value.target || {},