Skip to content

Strange behavior button card with color_type card #1132

@DozoG

Description

@DozoG

Checklist

  • [ V] I updated the card to the latest version available
  • [ V] I cleared the cache of my browser

Describe the bug
Button toggles a HA input_boolean. Button works correctly
When the boolean is true (ON) the color of the button is the specified color
First time the button goes OFF, color of the button turns the color of the card that the button is on
Then ON again for the specfied color
Second time the button goes OFF, color of the button turns black

Version of the card
Version:

To Reproduce
This is the code for the button I used:

  - type: custom:button-card
    template: icon_button2
    entity: input_boolean.trigger_br_standing
    icon: mdi:floor-lamp-outline
    color: yellow
    name: Floor
    tap_action:
      action: toggle

This is the template (from which I have already removed any references to color, but still shows the behavior)

  multiline_secondary: true
  icon_button2:
    aspect_ratio: 4/3
    color_type: card
    layout: vertical
    show_label: true
    show_name: true

I have noticed that while editing the code in thedashboard editor, the preview on the right side, shows the behavior as it did with a previous version of the card.

Screenshots
This is what a dashboard with some input_booleans ON and some OFF look like

  • On the PC in a chrome browser
Image

Note that the thick and square border are from the template icon_button2 , which is a copy of template icon_button , that I used to see if removing stuff would solve the problem. (I gave it square corners to distinguish them from the original.)

This is what it looks like in the preview (Also on PC in chrome browser)

Image

This is what it used to look like and what I expect it to look like

The incorrect (black) button color happens on any device.

Desktop (please complete the following information):

  • Browser [chrome]
  • Version [142.0.7444.176]

Smartphone (please complete the following information):

  • Device: [Android 14]
  • HomeAssisstant companian app

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions