DBuit / light-popup-card

Lovelace card to use as custom pop-up for light in homekit style
167 stars 38 forks source link

Light's that support colours will display as a switch and not a slider #91

Open AAllport opened 2 years ago

AAllport commented 2 years ago

Due to the line here: https://github.com/DBuit/light-popup-card/blob/3543c29b131303bc44b6c6ba874ca307f409b054/src/light-popup-card.ts#L161-L163

When a light supports RGB or XY, it renders us a switch, and not a slider. Whilst this is overridable, it would be great for it to be automatically picked up.

I'm not sure whether it would be best to list all of the supported light modes that are likely to have brightness or add a check for attrs.brightness Unfortunately, it looks like entities lose their brightness attr when turned off.

Twinsen68 commented 2 years ago

@AAllport How to fix it ? I have this problem. I only have a switch and not the slider. brgds

AAllport commented 2 years ago

It's possible to pass a displayType of slider which will have the same effect