1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Delete stop response variable on empty (#28362)

This commit is contained in:
karwosts
2025-12-04 22:38:39 -08:00
committed by GitHub
parent cca4cc512b
commit 086aa5fa28

View File

@@ -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,
});
}