iantrich / restriction-card

🔒 Apply restrictions to Lovelace cards
MIT License
254 stars 22 forks source link

[FR] Support auto-entities card #73

Closed chemelli74 closed 1 year ago

chemelli74 commented 2 years ago

Is your feature request related to a problem? Please describe. Cannot combine restriction-card with auto-entities card

Describe the solution you'd like Been able to lock a row from a list generated by auto-entities

Describe alternatives you've considered None so far

Additional context

chemelli74 commented 1 year ago

@iantrich, do you may consider the proposed FR ?

Simone

pschmitt commented 1 year ago

To use this card with auto-entities you can leverage this.entity_id:

This for example creates a grid of restricted light cards for all you lights:

type: custom:auto-entities
card:
  type: grid
  columns: 3
card_param: cards
filter:
  include:
    - domain: light
      options:
        type: custom:restriction-card
        card:
          type: light
          entity: this.entity_id
  exclude:
    - state: unavailable
    - state: unknown

Ref: https://github.com/thomasloven/lovelace-auto-entities#entity-options

chemelli74 commented 1 year ago

Finally found the tie to test your suggestion and with a bit of work I got it working as expected. Thank you very much for your help !

Simone