added lighting fading in and out, when connection is lost/reestablished
This commit is contained in:
@@ -101,7 +101,7 @@ void lightingSaveCallback(Control *sender, int type) {
|
||||
|
||||
prefs.putUChar("light_hue", lightingHue);
|
||||
prefs.putUChar("light_sat", lightingSaturation);
|
||||
prefs.putUChar("light_bright", lightingBrightness);
|
||||
prefs.putUChar("light_bright", lightingBrightnessSaved);
|
||||
|
||||
Serial.printf("Lighting saved (0–255): H=%d S=%d B=%d\n",
|
||||
lightingHue, lightingSaturation, lightingBrightness);
|
||||
@@ -246,6 +246,7 @@ void uiInit(uint16_t& tabSettings, uint16_t& tabLighting, uint16_t& tabCalibrati
|
||||
int sliderVal = sender->value.toInt(); // 0–100
|
||||
lightingHue = fromSlider(sliderVal); // convert to 0–255
|
||||
Serial.printf("Lighting Hue changed (RAM only): %d\n", lightingHue);
|
||||
lightingFading = false; // cancel fade if user moves slider
|
||||
applyLighting();
|
||||
}
|
||||
);
|
||||
@@ -261,6 +262,7 @@ void uiInit(uint16_t& tabSettings, uint16_t& tabLighting, uint16_t& tabCalibrati
|
||||
int sliderVal = sender->value.toInt(); // 0–100
|
||||
lightingSaturation = fromSlider(sliderVal);
|
||||
Serial.printf("Lighting Saturation updated (RAM only): %d\n", lightingSaturation);
|
||||
lightingFading = false; // cancel fade if user moves slider
|
||||
applyLighting();
|
||||
}
|
||||
);
|
||||
@@ -274,8 +276,10 @@ void uiInit(uint16_t& tabSettings, uint16_t& tabLighting, uint16_t& tabCalibrati
|
||||
tabLighting,
|
||||
[](Control *sender, int type) {
|
||||
int sliderVal = sender->value.toInt(); // 0–100
|
||||
lightingBrightness = fromSlider(sliderVal);
|
||||
lightingBrightnessSaved = fromSlider(sliderVal);
|
||||
lightingBrightness = lightingBrightnessSaved;
|
||||
Serial.printf("Lighting Brightness updated (RAM only): %d\n", lightingBrightness);
|
||||
lightingFading = false; // cancel fade if user moves slider
|
||||
applyLighting();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user