joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
856 stars 187 forks source link

Implemented option to invert color scale order #1185

Closed starwarsfan closed 4 months ago

starwarsfan commented 4 months ago

The default colorScale shows low values 'green' and high values 'red'. By setting colorScaleInvert:true this can easily be inverted, which allows proper coloring for values like i. e. battery SoC. Low values will now be displayed in 'red' vs. high values in 'green' color.

Armilar commented 4 months ago

nice

but what is the difference to the val_best parameter? With this you can already determine the direction...

Example: {val_min: 0, val_max: 3000, val_best: 3000} val_max is green

{val_min: 0, val_max: 3000, val_best: 0} or {val_min: 0, val_max: 3000} val_min is green

tt-tom17 commented 4 months ago

To turn the scale, it is sufficient to swap the min and max values. {val_min: 3000, val_max: 0} A new parameter brings no advantage or extension for the code.

starwarsfan commented 4 months ago

Well, seems I did something completely wrong because what you mentioned did not work as expected. But thx for clarification, I will check the configuration again.

tt-tom17 commented 4 months ago

@starwarsfan We are now closing the pull request or are there any comments?