mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 14:27:20 +00:00
Correctly color script state icon + handle "single" mode for cancel buttons (#8383)
This commit is contained in:
parent
7c1fd542da
commit
db9cea81db
@ -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="on"],
|
||||||
ha-icon[data-domain="media_player"][data-state="paused"],
|
ha-icon[data-domain="media_player"][data-state="paused"],
|
||||||
ha-icon[data-domain="media_player"][data-state="playing"],
|
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="sun"][data-state="above_horizon"],
|
||||||
ha-icon[data-domain="switch"][data-state="on"],
|
ha-icon[data-domain="switch"][data-state="on"],
|
||||||
ha-icon[data-domain="timer"][data-state="active"],
|
ha-icon[data-domain="timer"][data-state="active"],
|
||||||
|
@ -115,7 +115,7 @@ export class StateBadge extends LitElement {
|
|||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.warn(errorMessage);
|
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}%)`;
|
iconStyle.filter = `brightness(${(brightness + 245) / 5}%)`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,8 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
|
|||||||
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
|
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
|
||||||
${stateObj.state === "on"
|
${stateObj.state === "on"
|
||||||
? html`<mwc-button @click=${this._cancelScript}>
|
? html`<mwc-button @click=${this._cancelScript}>
|
||||||
${(stateObj.attributes.current || 0) > 0
|
${stateObj.attributes.mode !== "single" &&
|
||||||
|
(stateObj.attributes.current || 0) > 0
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
"ui.card.script.cancel_multiple",
|
"ui.card.script.cancel_multiple",
|
||||||
"number",
|
"number",
|
||||||
|
@ -33,7 +33,8 @@ export class StateCardScript extends LitElement {
|
|||||||
></state-info>
|
></state-info>
|
||||||
${stateObj.state === "on"
|
${stateObj.state === "on"
|
||||||
? html`<mwc-button @click=${this._cancelScript}>
|
? html`<mwc-button @click=${this._cancelScript}>
|
||||||
${(stateObj.attributes.current || 0) > 0
|
${stateObj.attributes.mode !== "single" &&
|
||||||
|
(stateObj.attributes.current || 0) > 0
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
"ui.card.script.cancel_multiple",
|
"ui.card.script.cancel_multiple",
|
||||||
"number",
|
"number",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user