piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.46k stars 325 forks source link

Transition property for light card #234

Open conorhub opened 2 years ago

conorhub commented 2 years ago

I don't believe there's currently a way to use a light bulb with a light card and have the light use its transition feature (fading in or out softly) unless the bridge implements it.

This is the case for something like the Philips Hue Bridge, using Hue light bulbs.

If you're to use the same Hue light bulb with something like a zigbee bridge, the transition is typically not automatically implemented and needs to be directly stated as a property by the action i.e. the mushroom card.

I can think of hacky ways of getting this to work involving scripts etc but thought it would defeat the purprose of mushroom being about simplicity. Might it be possible to include a transition property for lights alongside the current settings? Thanks

SaSa1983 commented 2 years ago

There's no need for this property. You can use the tap action in conjuction with call-service (light.toggle) and the service allows to set the transition duration:

type: custom:mushroom-light-card
entity: light.my_light_entity
use_light_color: true
show_brightness_control: true
show_color_temp_control: true
show_color_control: true
tap_action:
  action: call-service
  service: light.toggle
  service_data:
    transition: 5
  target:
    entity_id: light.my_light_entity
conorhub commented 2 years ago

I might be wrong, but I think that this only works for turning a light on or off. If I adjust the brightness via the slider it manifests as a rather abrupt jump, sending no transition property and it's not an option to use call-service via this action.

This is subjective but I thought there might actually be some demand for having a transition option on a light card. I can understand that a simple UI should avoid any niche options. On the other hand, solutions that involve using code in a call-service are perhaps beyond beginner-level and may defeat the ethos of mushroom cards. I guess it comes down to whether many would regularly use this option.

piitaya commented 2 years ago

Yep, it's only for action, not for slider. Thank's for the suggestion. For now, controls are only boolean option but I plan to add more customization for each control. Adjusting transition for slider can be a option 🙂

joezappie commented 8 months ago

Curious if there's been any movement on this. Playing around with changing my Hue bulbs to ZHA, moved one over to test. Noticed my non hue bridge bulb was abruptly changing colors while the rest all softly change. I really like that and would hate to lose it as it's such a subtle feature but really makes a huge impact.

Ps. Loving the mushroom card set and shadow theme. Definitely the best designed cards I've found.