diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index 56b2b825060b..5884f68be40f 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -391,7 +391,10 @@ export default class HaAutomationActionRow extends LitElement { > ` : html` -
+
${dynamicElement(`ha-automation-action-${type}`, { hass: this.hass, action: this.action, @@ -530,6 +533,15 @@ export default class HaAutomationActionRow extends LitElement { fireEvent(this, "value-changed", { value: ev.detail.value }); } + private _onUiChanged(ev: CustomEvent) { + ev.stopPropagation(); + const value = { + ...(this.action.alias ? { alias: this.action.alias } : {}), + ...ev.detail.value, + }; + fireEvent(this, "value-changed", { value }); + } + private _switchUiMode() { this._warnings = undefined; this._yamlMode = false; diff --git a/src/panels/config/automation/action/types/ha-automation-action-activate_scene.ts b/src/panels/config/automation/action/types/ha-automation-action-activate_scene.ts index 1950204d8496..5e61ca20341a 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-activate_scene.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-activate_scene.ts @@ -54,6 +54,7 @@ export class HaSceneAction extends LitElement implements ActionElement { ev.stopPropagation(); fireEvent(this, "value-changed", { value: { + ...this.action, service: "scene.turn_on", target: { entity_id: ev.detail.value, diff --git a/src/panels/config/automation/action/types/ha-automation-action-play_media.ts b/src/panels/config/automation/action/types/ha-automation-action-play_media.ts index f35c6438227b..bd1ee27ec363 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-play_media.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-play_media.ts @@ -51,6 +51,7 @@ export class HaPlayMediaAction extends LitElement implements ActionElement { ev.stopPropagation(); fireEvent(this, "value-changed", { value: { + ...this.action, service: "media_player.play_media", target: { entity_id: ev.detail.value.entity_id }, data: { diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index eb4558569e9a..ade44fa4e1cd 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -62,7 +62,7 @@ export default class HaAutomationConditionEditor extends LitElement { > ` : html` -
+
${dynamicElement( `ha-automation-condition-${condition.condition}`, { @@ -86,6 +86,15 @@ export default class HaAutomationConditionEditor extends LitElement { fireEvent(this, "value-changed", { value: ev.detail.value, yaml: true }); } + private _onUiChanged(ev: CustomEvent) { + ev.stopPropagation(); + const value = { + ...(this.condition.alias ? { alias: this.condition.alias } : {}), + ...ev.detail.value, + }; + fireEvent(this, "value-changed", { value }); + } + static styles = haStyle; } diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index cbc1e7bff34f..0db6ca2e3887 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -350,7 +350,10 @@ export default class HaAutomationTriggerRow extends LitElement { ` : ""} -
+
${dynamicElement( `ha-automation-trigger-${this.trigger.platform}`, { @@ -562,6 +565,15 @@ export default class HaAutomationTriggerRow extends LitElement { fireEvent(this, "value-changed", { value: ev.detail.value }); } + private _onUiChanged(ev: CustomEvent) { + ev.stopPropagation(); + const value = { + ...(this.trigger.alias ? { alias: this.trigger.alias } : {}), + ...ev.detail.value, + }; + fireEvent(this, "value-changed", { value }); + } + private _switchUiMode() { this._warnings = undefined; this._yamlMode = false;