nicufarmache / lovelace-big-slider-card

A card with a big slider for light entities in Home Assistant
MIT License
77 stars 11 forks source link

Wrong brightness percentage #23

Closed Kleeraphie closed 1 year ago

Kleeraphie commented 1 year ago

Checklist:

Release with the issue: 2023.3.6

Last working release (if known):

Browser and Operating System: Google Chrome 112.0.5615.49, Windows 11

Description of problem:

When changing the brightness of a WLED light, the card sometimes shows a higher brightness percentage than the Home Assistant more-info card.

In this example, WLED reports a brightness level of 97 out of 255, which is 97/255 = 38.04%. It seems like this card rounds the brightness up to 39%, while Home Assistant only rounds up if the brightness level is >= *.5%, so it rounds down to 38%.

Javascript errors shown in the web inspector (if applicable):

Additional information:

nicufarmache commented 1 year ago

I just merge a pull request that changed the behaviour so that it rounds at .5 Try the next version which will be out soon and see if this fixed your issue

Kleeraphie commented 1 year ago

This fixed the issue. Thank you.