mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-16 22:40:55 +00:00
Make clear that automation run button skips conditions + remove word "execute" from UI (#8259)
* Do not skip conditions when triggering an automation * Remove usage of word "execute" * More concise function names
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||
import { canExcecute, ScriptEntity } from "../../../data/script";
|
||||
import { canRun, ScriptEntity } from "../../../data/script";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||
import "../components/hui-generic-entity-row";
|
||||
@@ -66,12 +66,12 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
|
||||
: ""}
|
||||
${stateObj.state === "off" || stateObj.attributes.max
|
||||
? html`<mwc-button
|
||||
@click=${this._executeScript}
|
||||
@click=${this._runScript}
|
||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state) ||
|
||||
!canExcecute(stateObj)}
|
||||
!canRun(stateObj)}
|
||||
>
|
||||
${this._config.action_name ||
|
||||
this.hass!.localize("ui.card.script.execute")}
|
||||
this.hass!.localize("ui.card.script.run")}
|
||||
</mwc-button>`
|
||||
: ""}
|
||||
</hui-generic-entity-row>
|
||||
@@ -91,7 +91,7 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
|
||||
this._callService("turn_off");
|
||||
}
|
||||
|
||||
private _executeScript(ev): void {
|
||||
private _runScript(ev): void {
|
||||
ev.stopPropagation();
|
||||
this._callService("turn_on");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user