mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-12 03:07:13 +01:00
Clean up
This commit is contained in:
@@ -63,12 +63,6 @@
|
||||
#define LED1_PIN 2
|
||||
#define LED1_PIN_INVERSE 1
|
||||
|
||||
// Buttons
|
||||
// No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
|
||||
#define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
|
||||
// it's the same as using a Wemos one button shield
|
||||
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
|
||||
#define BUTTON1_RELAY 1
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// ESPurna
|
||||
|
||||
@@ -205,7 +205,7 @@ unsigned int _toPWM(unsigned long value, bool bright, bool gamma, bool reverse)
|
||||
// Returns a PWM valule for the given channel ID
|
||||
unsigned int _toPWM(unsigned char id) {
|
||||
if (id < _channels.size()) {
|
||||
bool isColor = (lightHasColor() && id < 3);
|
||||
bool isColor = lightHasColor() && (id < 3);
|
||||
bool bright = isColor;
|
||||
bool gamma = isColor & (getSetting("useGamma", LIGHT_USE_GAMMA).toInt() == 1);
|
||||
return _toPWM(_channels[id].shadow, bright, gamma, _channels[id].reverse);
|
||||
@@ -227,7 +227,7 @@ void _shadow() {
|
||||
|
||||
bool useWhite = getSetting("useWhite", LIGHT_USE_WHITE).toInt() == 1;
|
||||
|
||||
if (_lightState && useWhite && _channels.size() > 3) {
|
||||
if (_lightState && useWhite && (_channels.size() > 3)) {
|
||||
if (_channels[0].shadow == _channels[1].shadow && _channels[1].shadow == _channels[2].shadow ) {
|
||||
_channels[3].shadow = _channels[0].shadow * ((float) _brightness / LIGHT_MAX_BRIGHTNESS);
|
||||
_channels[2].shadow = 0;
|
||||
|
||||
Reference in New Issue
Block a user