lovelace-mushroom icon indicating copy to clipboard operation
lovelace-mushroom copied to clipboard

[Bug]: light card color temperature slider does not show coldest temperatures

Open hcoohb opened this issue 2 years ago • 5 comments

Current Behavior

When light has color temperature capability, HA displays the slider going from coldest to warmest temp as a blue to orange gradient. Mushroom card shows the slider going from white to orange. screenshot of both sliders

In your original implementation, the cold temp was correctly shown (and still on the readme example image), but later a PR #48 removed this to set to white as the coldest temp. While I did see there was a technical reason, I do believe this is actually kind of a UI issue.

Couple of reason:

  • The most obvious is that by having white as coldest light: you don't know what color you are setting! Quite a few HA integrations have spent some time aligning the scales so that the white HA is really the white of the light. Using the mushroom card, I cannot exactly see where is the actual white lamp.
  • When you bring up the HA more info panel for that light, the scale shows to from blue to orange, so having a white to orange scale in mushroom card is inconsistent and will throw user off balance as it is not expected. (I did thought there was an issue with my setup until I dig through the code of the mushroom card...)
  • I would argue that having the light icon to match the color temp slider is less of a priority for good design than having consistent slider scale with HA and being able to set colors properly

Expected Behavior

Having the same color temperature slider as HA in the mushroom card.

Steps To Reproduce

No response

Environment

- OS: 
- Node:
- Version:
- Hassio: 2022.5.4

Anything else?

No response

hcoohb avatar May 18 '22 04:05 hcoohb

The issue comes from the fact that homeassistant behaves rather inconsistently. The background color of the temperature slider does not match the color returned by the rgb_color attribute when the bulb changes color, as you can see below: image image As you can see, the color shown by the icon and the color shown by the slider are different. We can undoubtedly replicate the behavior of homeassistant, but as far as I'm concerned, it would only be able to confuse the user. image We could instead make sure to follow the color of the slider with the icon, but before posting yet another PR I would prefer to hear @piitaya 's opinion

alessandroias avatar May 18 '22 23:05 alessandroias

I've opened an issue into the homeassistant's repo.

alessandroias avatar May 19 '22 00:05 alessandroias

We can't follow the slider gradient because I think we can't detect that a light is in temp_color mode. The icon color is based on rgb_color attributes.

piitaya avatar May 19 '22 06:05 piitaya

@alessandroias Thanks for explaining that, I actually had never realized that the light icon color appear wrong on HA more info panel as well. Fixing that in HA would seem to be the first step. Thanks for opening an issue there!

But in the meantime we could basically replicate the HA behaviour in mushroom card. I.e: slider going from blue to orange, and light icon grey to orange.

@piitaya , I am not sure how mushroom card get the light details, but it seems (on my light at least) that the current color_mode and mi_red value is part of the attributes: image Not sure if that is the case for every light though.

hcoohb avatar May 19 '22 12:05 hcoohb

if hass.states[entity_id].attributes.color_mode === "color_temp" is true its in color temp mode.

You probably don't want to adjust the color temp slider based on the brightness value of the light as it will be quite confusing when its all pale grey.

bdraco avatar May 20 '22 05:05 bdraco