kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
116 stars 37 forks source link

transform the received dimming value to also fit the 10 to 100 range #57

Closed xmanu closed 3 years ago

xmanu commented 3 years ago

Hello, this pull request should hopefully fix issue #51.

While testing I found out, that setting the brightness to 1% resulted in the value jumping to 10% in some cases (when reading the value back from the bulb).

So I looked at the code and found the special handling of fitting the range to 10..100 while setting the brightness. While reading this was not "reversed" so I added that. This seems consistent with the Wiz App.

Please consider merging this request as this should fix some value inconsistencies in the Home App.

Best, Manuel

kpsuperplane commented 3 years ago

Thank you!