Fixed easeTime parameter for static mode
This commit is contained in:
parent
242155a64c
commit
65e34bfdd1
@ -142,6 +142,7 @@ Sets all steps to the same brightness.
|
||||
|
||||
Parameters:<br>
|
||||
**brightness** (word): value in range 0 (off) to 4095 (fully on).
|
||||
**easeTime** (word): the time in milliseconds to ease into the new brightness value (only applies if the mode was already set to static before).
|
||||
|
||||
|
||||
### Custom
|
||||
|
@ -9,7 +9,7 @@
|
||||
struct StaticModeParameters
|
||||
{
|
||||
uint16_t brightness;
|
||||
uint32_t easeTime;
|
||||
uint16_t easeTime;
|
||||
};
|
||||
|
||||
enum EaseState
|
||||
|
@ -95,7 +95,8 @@ function readModeData(mode, reader)
|
||||
{
|
||||
case protocol.Mode.Static:
|
||||
return {
|
||||
brightness: reader.nextInt16LE()
|
||||
brightness: reader.nextInt16LE(),
|
||||
easeTime: reader.nextInt16LE()
|
||||
};
|
||||
|
||||
case protocol.Mode.Custom:
|
||||
@ -157,7 +158,7 @@ function writeModeData(mode, data)
|
||||
case protocol.Mode.Static:
|
||||
var brightness = getBrightness(data.brightness);
|
||||
|
||||
return new Buffer([protocol.Command.SetMode, mode, lsb(brightness), msb(brightness)]);
|
||||
return new Buffer([protocol.Command.SetMode, mode, lsb(brightness), msb(brightness), lsb(500), msb(500)]);
|
||||
|
||||
case protocol.Mode.Custom:
|
||||
var brightness = typeof(data.brightness) !== 'undefined' ? data.brightness.split(',') : [];
|
||||
|
Loading…
Reference in New Issue
Block a user