mini-graph-card icon indicating copy to clipboard operation
mini-graph-card copied to clipboard

adaptive color not working as expected

Open pachi81 opened this issue 3 years ago • 4 comments

In version v0.10.0 the adaptive colors does not work as expected.

  1. Color names like "blue" does not work, only if it is the last color in the color_thresholds. (picture 1 and 2)
  2. color_thresholds_transition: smooth is not working for the second entity. (picture 2)
  3. color_thresholds at the step to next color are shown incorrect for the second entity (picture 3)

Example configuration:

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_number.test_nummer
  - type: custom:mini-graph-card
    name: Apaptive Color
    entities:
      - entity: input_number.test_nummer
        state_adaptive_color: true
      - entity: input_number.test_nummer
        state_adaptive_color: true
        show_state: true
    color_thresholds_transition: hard
    show:
      name_adaptive_color: true
      icon_adaptive_color: true
      graph: false
    color_thresholds:
      - value: 0
        color: green
      - value: 20
        color: yellow
      - value: 60
        color: orange
      - value: 80
        color: blue
      - value: 90
        color: purple
  - type: custom:mini-graph-card
    name: Apaptive Color
    entities:
      - entity: input_number.test_nummer
        state_adaptive_color: true
      - entity: input_number.test_nummer
        state_adaptive_color: true
        show_state: true
    color_thresholds_transition: smooth
    show:
      name_adaptive_color: true
      icon_adaptive_color: true
      graph: false
    color_thresholds:
      - value: 0
        color: '#02FF15'
      - value: 20
        color: '#ECFF02'
      - value: 60
        color: '#FFC902'
      - value: 80
        color: '#0215FF'
      - value: 90
        color: '#F002FF'

Different Results: If the value is higher then the last value, all work like expected: image If the value is lower then the last value, color names are not working and smooth is not working for the second entity: image For value 90, which is the border to use purple color, the second entity still shows the color from color threshold 80: image

pachi81 avatar Jan 14 '22 10:01 pachi81

Likely related to config handling for the first entity vs others; to be checked/confirmed before next release

jlsjonas avatar Feb 14 '22 11:02 jlsjonas

Anything I can do for confirmation?

pachi81 avatar Apr 26 '22 07:04 pachi81

I think I am getting the same issue, state_adaptive_color: true does not have smooth transitions, while name_adaptive_color: true works correctly: grafik

I only have one entity in my configuration though.

color_thresholds: - color: '#0000FF' value: 5 - color: '#FFFFFF' value: 15 - color: '#FFFFFF' value: 30 - color: '#FF0000' value: 35

ghost avatar May 02 '22 07:05 ghost