mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add response UI to stop action (#17045)
This commit is contained in:
parent
c3c062cc29
commit
6b4300950d
@ -19,7 +19,7 @@ export class HaStopAction extends LitElement implements ActionElement {
|
||||
}
|
||||
|
||||
protected render() {
|
||||
const { error, stop } = this.action;
|
||||
const { error, stop, response_variable } = this.action;
|
||||
|
||||
return html`
|
||||
<ha-textfield
|
||||
@ -30,6 +30,14 @@ export class HaStopAction extends LitElement implements ActionElement {
|
||||
.disabled=${this.disabled}
|
||||
@change=${this._stopChanged}
|
||||
></ha-textfield>
|
||||
<ha-textfield
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.actions.type.stop.response_variable"
|
||||
)}
|
||||
.value=${response_variable || ""}
|
||||
.disabled=${this.disabled}
|
||||
@change=${this._responseChanged}
|
||||
></ha-textfield>
|
||||
<ha-formfield
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.hass.localize(
|
||||
@ -45,14 +53,21 @@ export class HaStopAction extends LitElement implements ActionElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private _stopChanged(ev: CustomEvent) {
|
||||
private _stopChanged(ev: Event) {
|
||||
ev.stopPropagation();
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...this.action, stop: (ev.target as any).value },
|
||||
});
|
||||
}
|
||||
|
||||
private _errorChanged(ev: CustomEvent) {
|
||||
private _responseChanged(ev: Event) {
|
||||
ev.stopPropagation();
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...this.action, response_variable: (ev.target as any).value },
|
||||
});
|
||||
}
|
||||
|
||||
private _errorChanged(ev: Event) {
|
||||
ev.stopPropagation();
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...this.action, error: (ev.target as any).checked },
|
||||
|
@ -2652,6 +2652,7 @@
|
||||
"stop": {
|
||||
"label": "Stop",
|
||||
"stop": "Reason for stopping",
|
||||
"response_variable": "The name of the variable to use as response",
|
||||
"error": "Stop because of an unexpected error"
|
||||
},
|
||||
"parallel": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user