thomasloven / lovelace-template-entity-row

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

FR: Multiline support for "secondary" #71

Open ildar170975 opened 2 years ago

ildar170975 commented 2 years ago

Currently I have to use card-mod for this:

      - type: custom:template-entity-row
        entity: sun.sun
        secondary: |
          Elevation={{state_attr(config.entity,'elevation')}}
          rise & shine
        card_mod:
          style:
            div#wrapper: |
              .info.pointer .secondary {
                white-space: pre;
              }

изображение Is it possible to use the "white-space: pre;" option by default?

igorsantos07 commented 4 months ago

FYI this trick also works on the state block:

card_mod:
  style:
    div#wrapper: |
      .state { white-space: pre-line }

Just discovered pre-line, which helps with white-space difficulties around Jinja templates - it gets a bit troublesome when you want some space / line breaks, but not a bunch of space just because you indented the template haha