mirror of https://github.com/arendst/Tasmota.git
Fix restore all 5 channels at boot
This commit is contained in:
parent
1f521ed748
commit
0766cb7d92
|
@ -134,6 +134,12 @@
|
|||
#ifndef DEFAULT_DIMMER_MIN
|
||||
#define DEFAULT_DIMMER_MIN 0
|
||||
#endif
|
||||
#ifndef DEFAULT_LIGHT_DIMMER
|
||||
#define DEFAULT_LIGHT_DIMMER 10
|
||||
#endif
|
||||
#ifndef DEFAULT_LIGHT_COMPONENT
|
||||
#define DEFAULT_LIGHT_COMPONENT 255
|
||||
#endif
|
||||
|
||||
enum WebColors {
|
||||
COL_TEXT, COL_BACKGROUND, COL_FORM,
|
||||
|
@ -814,11 +820,11 @@ void SettingsDefaultSet2(void)
|
|||
Settings.pwm_frequency = PWM_FREQ;
|
||||
Settings.pwm_range = PWM_RANGE;
|
||||
for (uint32_t i = 0; i < MAX_PWMS; i++) {
|
||||
Settings.light_color[i] = 255;
|
||||
Settings.light_color[i] = DEFAULT_LIGHT_COMPONENT;
|
||||
// Settings.pwm_value[i] = 0;
|
||||
}
|
||||
Settings.light_correction = 1;
|
||||
Settings.light_dimmer = 10;
|
||||
Settings.light_dimmer = DEFAULT_LIGHT_DIMMER;
|
||||
// Settings.light_fade = 0;
|
||||
Settings.light_speed = 1;
|
||||
// Settings.light_scheme = 0;
|
||||
|
|
|
@ -879,7 +879,16 @@ public:
|
|||
// We apply dimmer in priority to RGB
|
||||
uint8_t bri = _state->DimmerToBri(Settings.light_dimmer);
|
||||
if (Settings.light_color[0] + Settings.light_color[1] + Settings.light_color[2] > 0) {
|
||||
_state->setColorMode(LCM_RGB);
|
||||
// The default values are #FFFFFFFFFF, in this case we avoid setting all channels
|
||||
// at the same time, see #6534
|
||||
if ( (DEFAULT_LIGHT_COMPONENT == Settings.light_color[0]) &&
|
||||
(DEFAULT_LIGHT_COMPONENT == Settings.light_color[1]) &&
|
||||
(DEFAULT_LIGHT_COMPONENT == Settings.light_color[2]) &&
|
||||
(DEFAULT_LIGHT_COMPONENT == Settings.light_color[3]) &&
|
||||
(DEFAULT_LIGHT_COMPONENT == Settings.light_color[4]) &&
|
||||
(DEFAULT_LIGHT_DIMMER == Settings.light_dimmer) ) {
|
||||
_state->setColorMode(LCM_RGB);
|
||||
}
|
||||
_state->setBriRGB(bri);
|
||||
} else {
|
||||
_state->setBriCT(bri);
|
||||
|
|
Loading…
Reference in New Issue