mirror of https://github.com/arendst/Tasmota.git
Tune rotary encoder color control
This commit is contained in:
parent
828a64815b
commit
b6495598de
|
@ -98,7 +98,7 @@ void RotaryHandler(void) {
|
|||
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("ROT: " D_CMND_COLORTEMPERATURE " %d"), rotary_position);
|
||||
Rotary.changed = 1;
|
||||
if (!LightColorTempOffset(rotary_position * 4)) { // Ct from 153 - 500
|
||||
LightColorOffset(rotary_position * 4); // Hue from 0 - 359
|
||||
LightColorOffset(rotary_position * 2); // Hue from 0 - 359
|
||||
}
|
||||
} else {
|
||||
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("ROT: " D_CMND_DIMMER " %d"), rotary_position);
|
||||
|
|
|
@ -1483,8 +1483,8 @@ void LightColorOffset(int32_t offset) {
|
|||
uint8_t sat;
|
||||
light_state.getHSB(&hue, &sat, nullptr); // Allow user control over Saturation
|
||||
hue += offset;
|
||||
if (hue < 0) { hue = 0; }
|
||||
if (hue > 359) { hue = 359; }
|
||||
if (hue < 0) { hue += 359; }
|
||||
if (hue > 359) { hue -= 359; }
|
||||
if (!Light.pwm_multi_channels) {
|
||||
light_state.setHS(hue, sat);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue