Correctly color script state icon + handle "single" mode for cancel buttons (#8383)

This commit is contained in:
Philip Allgaier 2021-02-24 17:18:38 +01:00 committed by GitHub
parent 7c1fd542da
commit db9cea81db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ export const iconColorCSS = css`
ha-icon[data-domain="media_player"][data-state="on"],
ha-icon[data-domain="media_player"][data-state="paused"],
ha-icon[data-domain="media_player"][data-state="playing"],
ha-icon[data-domain="script"][data-state="running"],
ha-icon[data-domain="script"][data-state="on"],
ha-icon[data-domain="sun"][data-state="above_horizon"],
ha-icon[data-domain="switch"][data-state="on"],
ha-icon[data-domain="timer"][data-state="active"],

View File

@ -115,7 +115,7 @@ export class StateBadge extends LitElement {
// eslint-disable-next-line
console.warn(errorMessage);
}
// lowest brighntess will be around 50% (that's pretty dark)
// lowest brightness will be around 50% (that's pretty dark)
iconStyle.filter = `brightness(${(brightness + 245) / 5}%)`;
}
}

View File

@ -54,7 +54,8 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.state === "on"
? html`<mwc-button @click=${this._cancelScript}>
${(stateObj.attributes.current || 0) > 0
${stateObj.attributes.mode !== "single" &&
(stateObj.attributes.current || 0) > 0
? this.hass.localize(
"ui.card.script.cancel_multiple",
"number",

View File

@ -33,7 +33,8 @@ export class StateCardScript extends LitElement {
></state-info>
${stateObj.state === "on"
? html`<mwc-button @click=${this._cancelScript}>
${(stateObj.attributes.current || 0) > 0
${stateObj.attributes.mode !== "single" &&
(stateObj.attributes.current || 0) > 0
? this.hass.localize(
"ui.card.script.cancel_multiple",
"number",