andrey-git / home-assistant-custom-ui

Custom UI elements for https://home-assistant.io
https://home-assistant.io
MIT License
527 stars 97 forks source link

input_datetime icon_color based on state #182

Open Krocko opened 4 years ago

Krocko commented 4 years ago

I want to change the color from an input_datetime if it is activ (the selected time is in the future). Is this possible?

a-x- commented 3 years ago

looks like this:

 templates:
    icon: >
      if (state === 'on') return 'mdi:sleep';
      return 'mdi:sleep-off';
    icon_color: >
      if (state === 'on') return 'rgb(251, 210, 41)';
      return 'rgb(54, 95, 140)';

but it’s not work for me