bokub / rgb-light-card

💡 A Home Assistant card for RGB lights
MIT License
441 stars 24 forks source link

Specify a color with brightness *and* color_temp? #70

Closed iandoesallthethings closed 2 years ago

iandoesallthethings commented 2 years ago

I saw in another closed issue that you can't use color_temp and rgb_color at the same time which totally makes sense. But is there a way to specify both brightness and temperature?

I'm looking for this kind of thing:

- type: 'custom:rgb-light-card'
  entity: light.bedroom_group
      colors:
        - name: dark
          brightness: 50
          color_temp: 500

        - name: warm
          brightness: 255
          color_temp: 500

        - name: bright
          brightness: 255
          color_temp: 300

This might have more to do with the light.turn_on service, but I can't quite find a definitive answer in the docs whether this is possible.

bokub commented 2 years ago

Yes, this is totally possible!

You have a small indentation issue (color should be at the same level as entity), but if you fix it, your config should work.

Edit: you also have to remove the name keys, I don't know why you have them in your config...

A correct configuration would look like this:

- type: 'custom:rgb-light-card'
  entity: light.bedroom_group
  colors:
    - brightness: 50
      color_temp: 500

    - brightness: 255
      color_temp: 500

    - brightness: 255
      color_temp: 300
iandoesallthethings commented 2 years ago

Thank you so much! The name part was just pseudo-code. I'm not super familiar with YAML quite yet so I was spitballing what I was going for. Thank you so much! :D