Browse Source

Rename variables

pull/785/head
Niklas Wagner 6 years ago
parent
commit
f116f30ef7
5 changed files with 2286 additions and 2285 deletions
  1. +5
    -5
      code/espurna/config/general.h
  2. BIN
      code/espurna/data/index.html.gz
  3. +5
    -5
      code/espurna/light.ino
  4. +2275
    -2274
      code/espurna/static/index.html.gz.h
  5. +1
    -1
      code/html/index.html

+ 5
- 5
code/espurna/config/general.h View File

@ -776,14 +776,14 @@
#define LIGHT_USE_WHITE 0 // Use the 4th channel as (Warm-)White LEDs
#endif
#ifndef LIGHT_USE_COLD_WHITE
#define LIGHT_USE_COLD_WHITE 0 // Use the 5th channel as Coldwhite LEDs, LIGHT_USE_WHITE must be 1.
#ifndef LIGHT_USE_CCT
#define LIGHT_USE_CCT 0 // Use the 5th channel as Coldwhite LEDs, LIGHT_USE_WHITE must be 1.
#endif
// Used when LIGHT_USE_WHITE AND LIGHT_USE_COLD_WHITE is 1 - (1000000/Kelvin = MiReds)
// Used when LIGHT_USE_WHITE AND LIGHT_USE_CCT is 1 - (1000000/Kelvin = MiReds)
// Warning! Don't change this yet, NOT FULLY IMPLEMENTED!
#define LIGHT_MIRED_W1 153 // Coldwhite Strip, Value must be __BELOW__ W2!! (Default: 6535 Kelvin/153 MiRed)
#define LIGHT_MIRED_W2 500 // Warmwhite Strip, Value must be __ABOVE__ W1!! (Default: 2000 Kelvin/500 MiRed)
#define LIGHT_COLDWHITE_MIRED 153 // Coldwhite Strip, Value must be __BELOW__ W2!! (Default: 6535 Kelvin/153 MiRed)
#define LIGHT_WARMWHITE_MIRED 500 // Warmwhite Strip, Value must be __ABOVE__ W1!! (Default: 2000 Kelvin/500 MiRed)
#ifndef LIGHT_USE_GAMMA
#define LIGHT_USE_GAMMA 0 // Use gamma correction for color channels


BIN
code/espurna/data/index.html.gz View File


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

@ -44,7 +44,7 @@ bool _light_use_cct = false;
bool _light_use_gamma = false;
unsigned long _light_steps_left = 1;
unsigned char _light_brightness = LIGHT_MAX_BRIGHTNESS;
unsigned int _light_mireds = round((LIGHT_MIRED_W1+LIGHT_MIRED_W2)/2);
unsigned int _light_mireds = round((LIGHT_COLDWHITE_MIRED+LIGHT_WARMWHITE_MIRED)/2);
#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY92XX
#include <my92xx.h>
@ -116,13 +116,13 @@ void _generateBrightness() {
if (_light_use_cct) {
// This change the range from 153-500 to 0-347 so we get a value between 0 and 1 in the end.
double miredFactor = ((double) _light_mireds - (double) LIGHT_MIRED_W1)/((double) LIGHT_MIRED_W2 - (double) LIGHT_MIRED_W1);
double miredFactor = ((double) _light_mireds - (double) LIGHT_COLDWHITE_MIRED)/((double) LIGHT_WARMWHITE_MIRED - (double) LIGHT_COLDWHITE_MIRED);
// set warm white
// set cold white
_light_channel[3].inputValue = 0;
_light_channel[3].value = round(((double) 1.0 - miredFactor) * white);
// set cold white
// set warm white
_light_channel[4].inputValue = 0;
_light_channel[4].value = round(miredFactor * white);
} else {
@ -1013,7 +1013,7 @@ void _lightConfigure() {
setSetting("useWhite", _light_use_white);
}
_light_use_cct = getSetting("useCCT", LIGHT_USE_COLD_WHITE).toInt() == 1;
_light_use_cct = getSetting("useCCT", LIGHT_USE_CCT).toInt() == 1;
if (_light_use_cct && ((_light_channel.size() < 5) || !_light_use_white)) {
_light_use_cct = false;
setSetting("useCCT", _light_use_cct);


+ 2275
- 2274
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 1
code/html/index.html View File

@ -1415,7 +1415,7 @@
<div id="miredsTemplate" class="template">
<div class="pure-g">
<label class="pure-u-1 pure-u-lg-1-4">Mireds</label>
<label class="pure-u-1 pure-u-lg-1-4">Mireds (Warm &harr; Cold)</label>
<input type="range" min="153" max="500" class="slider pure-u-lg-1-4" id="mireds">
<span class="slider mireds pure-u-lg-1-4"></span>
</div>


Loading…
Cancel
Save