custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.97k stars 242 forks source link

layout: hinders state styling #547

Open Rover2 opened 2 years ago

Rover2 commented 2 years ago

I stumbled upon the following issue with this quite basic button:

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        entity: sensor.hmip_dg_t2_temp
        icon: mdi:sleep
        show_state: true
        name: Attic
        layout: icon_name_state
        styles:
          state:
            - font-size: 0.65em
            - color: >-
                [[[ return states['climate.hmip_dg_r2'].state == 'auto' ? 'green' : 'orange'; ]]]

which results in this button without the desired styling of the state: grafik

If I comment # layout: icon_name_state, the styling appears: grafik

Is this a bug or rather desired behaviour? And in case of the latter: how to circumvent it?

Interesting: with layout: icon_state the styling gets applied: grafik