Open kenchris opened 6 years ago
In the latest commit (in the async branch), the LED methods now receive options objects to make it more clear what the options are.
Currently the LED modes in use are the ones predefined in the firmware for animation (breathe and oneShot), but I assume it can be possible to use the constant LED feature to continuously send new RGB values that will make animation. I will look more into it, it certainly would be a nice to have more control over the LEDs.
These are kind of higher level animations/effects, so what about something like
thingy.led.breathe({ duration: 1500, ... }).then(() => console.log("animation stopped"))
It should probably receive an options array like above, so make it more clear what the numbers actually mean.
LED effects can actually easily turn a bit complicated, like look at Johnny Five
It might make some sense to align names etc with https://developer.mozilla.org/en-US/docs/Web/API/Animation
I also think it might make sense to just return a promise which executes when done instead on an onstop method.