From 086aa5fa2853bf903bdcd6e221bc0dde38e4b8fc Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:38:39 -0800 Subject: [PATCH] Delete stop response variable on empty (#28362) --- .../automation/action/types/ha-automation-action-stop.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panels/config/automation/action/types/ha-automation-action-stop.ts b/src/panels/config/automation/action/types/ha-automation-action-stop.ts index c8d15c3e95..8e4af79235 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-stop.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-stop.ts @@ -64,8 +64,15 @@ export class HaStopAction extends LitElement implements ActionElement { private _responseChanged(ev: Event) { ev.stopPropagation(); + const newAction = { ...this.action }; + const newValue = (ev.target as any).value; + if (newValue) { + newAction.response_variable = newValue; + } else { + delete newAction.response_variable; + } fireEvent(this, "value-changed", { - value: { ...this.action, response_variable: (ev.target as any).value }, + value: newAction, }); }