Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button_card_templates support to state oprator. #882

Open
PavelD opened this issue Nov 15, 2024 · 1 comment
Open

Add button_card_templates support to state oprator. #882

PavelD opened this issue Nov 15, 2024 · 1 comment
Labels
FR Feature Request

Comments

@PavelD
Copy link

PavelD commented Nov 15, 2024

I want to use button_card_templates when state with operator option is defined.

This will keep me simple card buttons and complex card buttons inline and easy to update form one central point (button_card_templates object).

Hope this dummy example with show it better.

button_card_templates:
  alarm_color:
    color: var(--red-color)

square: false
type: grid
cards:
  - type: custom:button-card
     name: Not working
     icon: mdi:radiator
     color_type: card
     entity: input_select.cb_example
     state:
       - operator: template
          value: |
            [[[ return entity.state === 'choose1' ]]]
          name: 'Choice I - not working'
          template: alarm_color
       - operator: template
          value: |
            [[[ return entity.state === 'choose2' ]]]
          name: 'Choice II - working no template'
          color: '#ff0000'
  - type: custom:button-card
    name: Working
    icon: mdi:home-lightbulb
    color_type: card
    aspect_ratio: 2/1.1
    template: alarm_color
@PavelD PavelD added the FR Feature Request label Nov 15, 2024
@PavelD
Copy link
Author

PavelD commented Nov 15, 2024

There is workaround to use type: conditional and not use complex structures in button-card

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant