iantrich / config-template-card

📝 Templatable Lovelace Configurations
MIT License
449 stars 59 forks source link

Entities icon change does not work #29

Closed theHasp closed 4 years ago

theHasp commented 4 years ago

I just want to change the icon based on the state ... so far so simple ...

It seems like there is a sanitizer running over the json removing all the " which breaks the condition

So when I store

icon: "${states[cover.fenster_sued].state === 'open' ? 'mdi:window-shutter-open' : 'mdi:window-shutter' }"

will be automatically replaced by

icon: >-
        ${states[cover.fenster_sued].state === 'open' ?
        'mdi:window-shutter-open' : 'mdi:window-shutter' }

which of course breaks the whole thing

What am I do wrong .... THANKS

iantrich commented 4 years ago

that's not breaking it, your lack of quotes on cover.fenster_sued breaks it

theHasp commented 4 years ago

THANKS ... that was easy :-) AND DEFINITELY NOT A BUG