mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 22:37:21 +00:00
Prevent wrong colors in history timeline for inverted unavailable states (#10137)
This commit is contained in:
parent
8e3011807d
commit
375a5323d5
@ -56,7 +56,11 @@ const getColor = (
|
|||||||
entityState: HassEntity,
|
entityState: HassEntity,
|
||||||
computedStyles: CSSStyleDeclaration
|
computedStyles: CSSStyleDeclaration
|
||||||
) => {
|
) => {
|
||||||
if (invertOnOff(entityState)) {
|
// Inversion is only valid for "on" or "off" state
|
||||||
|
if (
|
||||||
|
(stateString === "on" || stateString === "off") &&
|
||||||
|
invertOnOff(entityState)
|
||||||
|
) {
|
||||||
stateString = stateString === "on" ? "off" : "on";
|
stateString = stateString === "on" ? "off" : "on";
|
||||||
}
|
}
|
||||||
if (stateColorMap.has(stateString)) {
|
if (stateColorMap.has(stateString)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user