I ended up to move almost all shared code from “secrets” to “include” (btw, nobody advised me to use “secrets” for reused code - and never read about this practice here before myself).
What is only left in “secrets” are one-string definitions like:
(I understand that this topic is a year+ old, but this just perfectly suits my needs ).
I’ve been working on a template-gauge-card which is just the HA gauge card with templatable parameters. On Facebook someone requested a ‘gradient’-feature which made me really interested to see if I could pull that off. Currently I’ve got a proof-of-concept working which dynamically works with your input (left):
The question for me now to answer is how gradients should actually work. For this I created a discussion in my GitHub repo and would love to either get input here or in my GH discussion.
Basically my question is as follow:
Given the following segments:
segments:
- from: 0
color: red
- from: 20
color: yellow
- from: 30
color: green
→ Where should the ‘peak’ of the color be. At the given values, so the peak of yellow should be at 20 etc, or should the peak in the middle of the segment, so 25 for yellow. For ‘option 2’ the gradient will ‘never’ start at 0, because red will start at 10, and 0 to 10 will just be red.
(Sorry if this was discussed here before, couldn’t really find anything related)