thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

Secondary info cannot be styled #78

Closed Sesshoumaru-sama closed 2 years ago

Sesshoumaru-sama commented 2 years ago

Hi

I am trying to have the secondary info a certain color depending on the state of a sensor (on/off). When its indoor warmer than outdoor than color should be green (airing makes sense) otherwise red (airing makes no sense).

Example:

type: custom:template-entity-row entity: sensor.indoor_temperature name: Temperatur state: | {{states(config.entity)}} {{state_attr(config.entity, 'unit_of_measurement')}} secondary: 'Outdoor-Gradient: {{states(''sensor.livingroom_lft'')}} °C' card_mod: style: | {% if states('binary_sensor.lr_airing') == 'off' %} .info { color: red } {% endif %}

Now with ".info" the mainline of the row gets red - okay, with ".state" the state value. But when I use ".secondary" nothing happens. Seems because the color is always taken from variable "--secondary-text-color". It would be cool if the styling would work. Maybe I am doing something wrong?

Sesshoumaru-sama commented 2 years ago

Nevermind... me being stupid, of cause ist must be ... .info.pointer .secondary