bokub / rgb-light-card

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

Potability to set scene rather than colour? #5

Closed gdeboos closed 4 years ago

gdeboos commented 4 years ago

It would be awesome if we could run a scene as well as set colour for single light. Especially because you can use gradients as the background colour of the icon.

bokub commented 4 years ago

That's an excellent idea.

How would you imagine the card configuration to be like ?

gdeboos commented 4 years ago

Without deep diving into this, I assume you are currently forwarding the color configuration data to the light.turn_on service.

Could you look for a new config option of type and where it is set to scene, run the scene from another new option? Default type to something like light for backwards compatibility.

Something like:

colors:
  - type: light
    rgb_color:
    - 255
    - 127
    - 255
  - type: scene
    scene: my_scene_name
  - hs_color:
    # no type but defaults to light
    - 60
    - 30
bokub commented 4 years ago

Published in 1.3.0 !

The config is like this:

colors:
  - type: scene
    entity_id: scene.my_scene
  - hs_color:
    - 60
    - 30