battery-state-card icon indicating copy to clipboard operation
battery-state-card copied to clipboard

Color thresholds for values below 0 (plus optionally allowing >/< syntax)

Open bcutter opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. With HA Companion app 2022.8 for Android the battery power sensor has been introduced. This gives the current power usage, e. g.: grafik Currently a color threshold can not be set for negative values (<0). Syntactically it's also not possible to work with "great than" and "lower than".

Describe the solution you'd like At least allow negative values to work with color_thresholds. >/< would be an optional nice thing. So either:

    color_thresholds:
      - value: <0
        color: red
      - value: 0
        color: yellow
      - value: >0
        color: green

or at least

    color_thresholds:
      - value: -0.01
        color: red
      - value: 0
        color: yellow
      - value: 0.01
        color: green

Currently for negative values the color_threshold is not applied, even if value is set as 0.

Additional context

bcutter avatar Aug 28 '22 15:08 bcutter