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

Ignore brightness for turned off light #378

Closed
2 tasks done
andreypolyak opened this issue Oct 6, 2020 · 1 comment
Closed
2 tasks done

Ignore brightness for turned off light #378

andreypolyak opened this issue Oct 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@andreypolyak
Copy link

Checklist

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

Describe the bug
I have a horizontal stack with two buttons to control lights (please see below YAML configuration and screenshot). The first light doesn't have a brightness attribute when it is turned off:
image
The second one has it:
image

Because of that, the button for the second light is filled in black color when in fact they don't have any difference in their real state -- they are both turned off:
image

The style for the first button:
style="--button-card-light-color:var(--paper-card-background-color); --button-card-light-color-no-temperature:var(--paper-card-background-color);"

The style for the second button:
style="--button-card-light-color:rgb(16, 16, 18); --button-card-light-color-no-temperature:rgb(16, 16, 18);"

If I manually update the state for the second light and delete the brightness attribute:
image

Both buttons start to have the same color:
image

And the same style:
style="--button-card-light-color:var(--paper-card-background-color); --button-card-light-color-no-temperature:var(--paper-card-background-color);"

Version of the card
Version: 3.3.6

To Reproduce
This is the configuration I used:

    - type: custom:button-card
      name: Theo
      entity: light.group_bedroom_top_theo
      color: auto
      color_type: card
      icon: mdi:lightbulb
      show_label: false
      show_name: true
      hold_action:
        action: more-info
        entity: light.group_bedroom_top_theo
        haptic: success
      tap_action:
        action: call-service
        service: script.fire_custom_event
        service_data:
          custom_event_data: group_bedroom_top_theo_virtual_switch_individual_toggle
        haptic: success
      styles:
        card:
          - height: 72px
    - type: custom:button-card
      name: Bedroom
      entity: light.bedroom_wardrobe
      color: auto
      color_type: card
      icon: mdi:wardrobe-outline
      show_label: false
      show_name: false
      hold_action:
        action: more-info
        entity: light.bedroom_wardrobe
        haptic: success
      tap_action:
        action: call-service
        service: script.fire_custom_event
        service_data:
          custom_event_data: bedroom_wardrobe_virtual_switch_individual_toggle
        haptic: success
      styles:
        card:
          - height: 72px

Expected behavior
Ignore the brightness of the turned-off light when computing the color for the button.

Desktop (please complete the following information):

  • Browser Chrome
  • Version 85.0.4183.121 (Official Build) (64-bit)
@RomRider
Copy link
Collaborator

Fixed in 3.4.0-1. Enable the beta versions for button-card in HACS to see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants