JakeBednard / node-phea

An unoffcial Phillips Hue Entertainment API library for Node.js
MIT License
32 stars 8 forks source link

Docs on how extension should be done #12

Open ewjmulder opened 3 years ago

ewjmulder commented 3 years ago

Nice lib, got it to work in my home, thanks! I am planning for a very simple use case: if my kids make too much noise, the lights will quickly flash red a few times. I tried the regular API but it's not fast enough for my taste. The entertainment API should make this possible. First I tried the transition function you have implemented. It works ok, but the timing is not perfect cause I have to wait for dim -> bright, then go back to dim and the timing of the setTimeout and the engine loop are not in sync well enough for the flashing to work properly.

My idea is to have a 'native' flashing function, which takes a from, to, time and amount to calculate the flashing in 1 smooth go. The main docs say the lib is meant as a basic start and can be extended for more advanced uses. So now my question is: what is your advised way to do that? How can I add functionality to the engine and the lights without having to change the original sources? Thanks for any advice on this!