treban / pimatic-tradfri

This plugin provides a tradfri interface for pimatic.
https://pimatic.org/plugins/pimatic-tradfri/
GNU General Public License v2.0
11 stars 3 forks source link

Color percentage is shown wrong in Pimatic #18

Closed sverrevh closed 7 years ago

sverrevh commented 7 years ago

It seems that there is something wrong with the color percentages as they are shown in Pimatic. When setting the color it does seem to set the lamp to the right color %, but the color % is shown wrong in Pimatic. If you slide it to 20, it jumps back to 12, but it did set it to 20%. If you slide it to 25% it jumps back to 18% in pimatic.

20%->12%, 30%->23%, 40%->34%, 50%->45%, 60%->57%, 70%->68%, 80%->80%, 90%->91%.

offset: -8%, -7%, -6%, -5%, -3%, -2%, 0%, +1%

I think there is some kind of error in a formula for calculating the % reported back by the gateway.

This is likely introduced by v0.1.12, but I only noticed now as I upgraded from 0.1.11 to 0.1.14

treban commented 7 years ago

I have the same bug. I changed with the RGB Bulbs the calculation function. ..will fix it

treban commented 7 years ago

Version 0.1.15 should fix the bug

sverrevh commented 7 years ago

Thanks for the quick fix! It now works as expected again.