mirror of https://github.com/arendst/Tasmota.git
Only advance to next palette color when fade is down
This commit is contained in:
parent
3fef91d6ca
commit
b6e62bf715
|
@ -1702,17 +1702,19 @@ void LightCycleColor(int8_t direction)
|
||||||
|
|
||||||
#ifdef USE_LIGHT_PALETTE
|
#ifdef USE_LIGHT_PALETTE
|
||||||
if (Light.palette_count) {
|
if (Light.palette_count) {
|
||||||
if (0 == direction) {
|
if (!Light.fade_running) {
|
||||||
Light.wheel = random(Light.palette_count);
|
if (0 == direction) {
|
||||||
}
|
Light.wheel = random(Light.palette_count);
|
||||||
else {
|
|
||||||
Light.wheel += direction;
|
|
||||||
if (Light.wheel >= Light.palette_count) {
|
|
||||||
Light.wheel = 0;
|
|
||||||
if (direction < 0) Light.wheel = Light.palette_count - 1;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Light.wheel += direction;
|
||||||
|
if (Light.wheel >= Light.palette_count) {
|
||||||
|
Light.wheel = 0;
|
||||||
|
if (direction < 0) Light.wheel = Light.palette_count - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LightSetPaletteEntry();
|
||||||
}
|
}
|
||||||
LightSetPaletteEntry();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // USE_LIGHT_PALETTE
|
#endif // USE_LIGHT_PALETTE
|
||||||
|
|
Loading…
Reference in New Issue