futomi / node-lifx-lan

The node-lifx-lan is a Node.js module which allows you to communicate with the Wi-Fi LED smart light products "LIFX" using the LAN protocol.
MIT License
68 stars 33 forks source link

Custom Wave Animation #17

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi ! First I have to tell you that this is a great library. I'm trying to update de color using a custom wave form instead of the "WaveForm" feature that comes with the API, but when I try to update the color ( i'm just changing the brightness), the fixture starts to flicker. I' m updating the brightness each 1ms.

If increase the time between each update (each 500ms) it works, but is not a smooth change. Any suggestions? I'm new working with node js, so i don't know if I'm updating properly the color on the Fixture, I use a "setInterval" function to update it.

Thank you.

ristomatti commented 5 years ago

@KidMustard Update each millisecond is too fast if you're sending regular color/brightness change messages like you said. From LIFX LAN protocol documentation:

Limits

  • Maximum recommended message transmit rate to a device: 20 per second

The only way I know to achieve faster or smoother updates using regular color/brightness messages is to set a duration for the transition.