FamousWolf / week-planner-card

Custom Home Assistant card displaying a responsive overview or multiple days with events from one of multiple calendars
MIT License
196 stars 15 forks source link

Hide card if no events #109

Closed Flintr closed 2 weeks ago

Flintr commented 3 months ago

I use the card and show 1 day. It would be great to have an option to hide the card if there are no events, instead of showing the “no events” text. I don’t think there’s a straightforward way to create a template sensor that counts events (and pair it with a conditional card), which was my first approach.

FamousWolf commented 2 months ago

I haven't tested it, but you can probably already do this with card_mod. Something like this should work:

card_mod:
  style: |
    ha-card:has(.none) {
      display: none !important;
    }