kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.06k stars 237 forks source link

line_color and color_treshold aren't entity specific? #1148

Closed Nickduino closed 1 month ago

Nickduino commented 1 month ago

This might be me but I don't get why this doesn't work:

image

While this does :

image

What if I wanted dynamic colors for both lines (but with different thresholds)? How could I do that?

ildar170975 commented 1 month ago

Color thresholds is a global option. There is a PR for making thresholds per entity: https://github.com/kalkih/mini-graph-card/issues/153

Nickduino commented 1 month ago

There is a PR for making thresholds per entity: #153

Ok. But that was a secondary question.

Can you tell me why my first example didn't work while the second did (so, one dynamic line and one light blue line) with nearly the same code?

ildar170975 commented 1 month ago

“line_color” is a global option. It is mainly supposed to be used for a single-entity card. Otherwise it is supposed to be defined as a list - for many-entities card. For static colors, it is advised to use a “color” option per-entity. If defined - it overrides “color_thresholds”.

Based on said:

  1. The 1st card contains wrong code - misplaced “line_color” and misplaced “color_thresholds”. Default colors are used.
  2. The 2nd card contains “color” for the 1st entity and a global “color_thresholds”: so the 2nd entity uses a dynamic color, the 1st entity uses a static defined color.
Nickduino commented 1 month ago

Thank you!