royto / logbook-card

Logbook card for Home Assistant UI Lovelace
GNU General Public License v3.0
204 stars 9 forks source link

Styling based on the value of an attribute ? #115

Closed ech58 closed 8 months ago

ech58 commented 8 months ago

Hello,

Do you think it is possible to change the style (with card-mod) of an attribute, based on its value (in each logbook line) ?

Eric

royto commented 8 months ago

Duplicate of #106 no ?

ech58 commented 8 months ago

I think I have the same problem as described in the issue you mentionned : How to reference in card mod an attribute's value of each entity displayed on each current line of the logbook ? I know this is more a question linked to card-mod than to your custom card but maybe you could have an idea ? I have also post the question here.

ech58 commented 8 months ago

Hello, Just FYI ... My goal was to differentiate a line of the logbook from another line by changing the color, depending on the value of the attribute "type" : if type = "info" then green if type = "alarme" then red

I succeed to do that with

    state_map:
      - value: '*'
        icon: mdi:bell
        icon_color: DarkRed
        attributes:
          - name: type
            value: alarme
      - value: '*'
        icon: mdi:information
        icon_color: DarkGreen
        attributes:
          - name: type
            value: info
royto commented 8 months ago

So can we close the issue ?

ech58 commented 8 months ago

Yes we can Thank you