PiotrMachowski / Home-Assistant-Lovelace-Local-Conditional-card

This card can show and hide a specific card on current device while not affecting other windows. It does not require any integration to run.
MIT License
61 stars 6 forks source link

Multiple cards to show/hide #1

Closed RomRider closed 4 years ago

RomRider commented 4 years ago

Hi,

Love the idea, I was thinking about how to have local variables in the browser only lately and this seems the best way to achieve it.

It would be interesting to be be able be able to have a service call that would take a bunch of id and show/hide them based on the service data. something like:

service: local_conditional_card.control
service_data:
  id1: true
  id2: false

true would show the card with the correspond id false would hide a card with the corresponding id

My use case would be a menu (I'm using an input_select for now): menu

It would still require a way to know which id is shown and which is not in the menu header, maybe by injecting some values into the hass object so that it can be accessed outside. It would also require the ability to define the default visibility of a card.

Let me know what you think :)

PiotrMachowski commented 4 years ago

Nice idea, it shouldn't be hard to implement ;) I will check it out

PiotrMachowski commented 4 years ago

Implemented in v1.1.0

RomRider commented 4 years ago

Nice! Thanks. :clap:

Is there a way to know which card is displayed? To be able to highlight the menu header I'd need to be able to access that information from an object, probably the hass object?

PiotrMachowski commented 4 years ago

For now I didn't have to save this information, it should be possible to store it in hass object.