custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
386 stars 30 forks source link

Default referencing variable #62

Open clinta opened 1 year ago

clinta commented 1 year ago

I'd like to be able to reference variables in defaults. For example:

decluttering_templates:
  room_card:
    default:
      light_entity: 'light.[[room]]'
  card:
    type: entity
    entity: '[[light_entity]]'

That template could then be used with either of the following:

- type: custom:decluttering-card
  template: room_card
  variables:
    - room: office
- type: custom:decluttering-card
  template: room_card
  variables:
    - room: office
    - light_entity: light.office_floor_lamp