diff --git a/code/espurna/light.ino b/code/espurna/light.ino index 5ecd79cd..f1146949 100644 --- a/code/espurna/light.ino +++ b/code/espurna/light.ino @@ -282,14 +282,14 @@ void _fromHSV(const char * hsv) { void _fromKelvin(unsigned long kelvin) { if (!_light_has_color) return; + + _light_mireds = constrain(round(1000000UL / kelvin), LIGHT_MIN_MIREDS, LIGHT_MAX_MIREDS); if (_light_use_cct) { _setRGBInputValue(LIGHT_MAX_VALUE, LIGHT_MAX_VALUE, LIGHT_MAX_VALUE); return; } - _light_mireds = constrain(round(1000000UL / kelvin), LIGHT_MIN_MIREDS, LIGHT_MAX_MIREDS); - // Calculate colors kelvin /= 100; unsigned int red = (kelvin <= 66)