|
@ -282,14 +282,14 @@ void _fromHSV(const char * hsv) { |
|
|
void _fromKelvin(unsigned long kelvin) { |
|
|
void _fromKelvin(unsigned long kelvin) { |
|
|
|
|
|
|
|
|
if (!_light_has_color) return; |
|
|
if (!_light_has_color) return; |
|
|
|
|
|
|
|
|
|
|
|
_light_mireds = constrain(round(1000000UL / kelvin), LIGHT_MIN_MIREDS, LIGHT_MAX_MIREDS); |
|
|
|
|
|
|
|
|
if (_light_use_cct) { |
|
|
if (_light_use_cct) { |
|
|
_setRGBInputValue(LIGHT_MAX_VALUE, LIGHT_MAX_VALUE, LIGHT_MAX_VALUE); |
|
|
_setRGBInputValue(LIGHT_MAX_VALUE, LIGHT_MAX_VALUE, LIGHT_MAX_VALUE); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_light_mireds = constrain(round(1000000UL / kelvin), LIGHT_MIN_MIREDS, LIGHT_MAX_MIREDS); |
|
|
|
|
|
|
|
|
|
|
|
// Calculate colors
|
|
|
// Calculate colors
|
|
|
kelvin /= 100; |
|
|
kelvin /= 100; |
|
|
unsigned int red = (kelvin <= 66) |
|
|
unsigned int red = (kelvin <= 66) |
|
|