apatsufas / homebridge-tapo-p100

Homebridge TP-LINK Tapo P100 Platform Plugin
Apache License 2.0
64 stars 14 forks source link

Color change Fixed. #27

Closed Woojin-Crive closed 2 years ago

Woojin-Crive commented 2 years ago

It takes time when a bulb get "change a color" request. So plugin should not use same function (setColor) when it cahnges hue,saturation.

Thank you for your effort. Happy new Year~!

apatsufas commented 2 years ago

Thanks again. Published in 1.4.16-beta2

Woojin-Crive commented 2 years ago

Without separating functions, non-applied(previous) value is inserted when calling setHue(hue value is good but saturation value is previous value) and setSaturation(same situation as setHue). So We have to set color several times in Google Home and Apple HomeKit in order to set color properly. Isn't it?

apatsufas commented 2 years ago

The problem is the Tapo API doesn't accept the set_device_info requests with only the hue or saturation values set. It does need both in order for the request to be accepted. I played with queuing the requests or sending only when both hue or saturation have changed but that didn't make any real difference in usage. I will have to check some other possibilities when I get around to it.

apatsufas commented 2 years ago

From my testing currently HomeKit will sent two requests. The first for hue with the wrong saturation but with the correct hue and one for saturation with both values correct. If you are experiencing something else maybe I could set the sysinfo hue and saturation values immediately without waiting for the request to respond. So at least one of the requests will be correct.