Browse Source

_light_mireds must be set before we return;

rfm69
Niklas Wagner 6 years ago
committed by GitHub
parent
commit
409d2f7f90
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      code/espurna/light.ino

+ 2
- 2
code/espurna/light.ino View File

@ -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)


Loading…
Cancel
Save