konradknitter / homebridge-philips-tv-ambilight

Apache License 2.0
16 stars 5 forks source link

Corrections on brightness value #5

Open TheVosh opened 2 years ago

TheVosh commented 2 years ago

Thanks for your great work. Your plug-in does the bobbin a simple yet effective manner.

But I noticed how the brightness was always very low. Looking into your code I found how you don’t recalculate the values to fit the Philips API specifications. Most obviously the brightness. HomeKit passes 0-100 values whereas the API expects 0-255. By adding a simple value*2.55 correction calculation to the passed value I was able to correct the brightness levels. I assume the same goes for saturation.

If I find the time, I’ll prepare a PR with proper corrections. If anyone else gets around to it beforehand, go for it.

https://github.com/eslavnov/pylips/blob/18aa80f171e2087a5e514d9272b8aefa2ec1737d/README.md#built-in-commands Number 65. ambilight_color - Sets ambilight color (in HSB format). Requires a valid --body argument: {"hue": 360, "saturation": 100, "brightness": 255}

andreizet66 commented 2 years ago

Hello! Did you get around to correct the color hue? This is the best plugin I found for this and unfortunately the colors and brightness dont work. Do you know how I could fix this by myself?

Flavien06 commented 1 year ago

Hi, Same for me This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 255 exceeded maximum of 100. See https://homebridge.io/w/JtMGR for more info. How to correct? Or update plugin please?