Joery-M / Govee-LAN-Control

An Node.js package to control Govee devices with LAN
https://joery.com/govee-lan-control
MIT License
21 stars 4 forks source link

colorKelvin behavior #10

Open kaohlive opened 8 months ago

kaohlive commented 8 months ago

Hi,

Thanks for this great module, really helped me implement the local api quickly into my Homey app. I have everything working perfectly except the color Kelvin part. In the cloud API I get an missing element of the Kelvin value if the mode is color and a filled version when the mode is color temp. In your implementation I always get the colorKelvin value. So it is now impossible to detect when what color mode is used. Can that be added?

Another related issue, in the cloud version a device has a range for the color Kelvin, and I seem to miss that here. I need it to calculate a percentage because my platform uses color temp percentages. THe ranges seem to differ between Goveee devices. Is that info that can be exposed in your module also?

Thanks for the great work, I am sure we will make a lot of Homey users happy by adding the local api device support.

Kaoh

kaohlive commented 8 months ago

Ok, sorry for this, I read the documentation of the local API better. I see there is a range mentioned there, so assuming thats fixed in this api between 2000K-7000K. That answers my first question. The second one, it states the kelvin value can be 0 to indicate its not the active mode. The other way around is a bit more tricky but based on the app and the messages I conclude its, color rgb is than 255,255,255. So if I receive a color white I can retrieve the Kelvin from the state and use that. If I receive any other color I can assume I need to ignore the Kelvin. I am going forward with this for now.

Again, great work, love the implementation.

kaohlive commented 8 months ago

One thing I keep missing, is an update event in case of just colorKelvin is updated.