From cb1e705fa036fc7b6037d1759a5b1f34ee756495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 26 Sep 2023 02:36:11 -0300 Subject: [PATCH] WIP: Always turns off secs after booting --- src/components/RGBLed.hpp | 9 +++++++++ src/config.h | 2 +- src/src.ino | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/RGBLed.hpp b/src/components/RGBLed.hpp index 0f64790..eb6b7d9 100644 --- a/src/components/RGBLed.hpp +++ b/src/components/RGBLed.hpp @@ -92,9 +92,18 @@ class RGBLed { uint8_t b = this->settings.getRgbBlue(); this->color = { r, g, b }; + if (this->shouldTurnOn()) + this->turnOnAnimated(); + else + this->turnOffAnimated(); + this->updateLedDisplayValues(); } + bool shouldTurnOn() { + return !isOn && this->targetBrightness != 0; + } + void run() { this->red.run(); this->green.run(); diff --git a/src/config.h b/src/config.h index afade03..2155ab0 100644 --- a/src/config.h +++ b/src/config.h @@ -21,5 +21,5 @@ namespace pins { } namespace device { - const String VERSION = "v1.2.0-rc1"; + const String VERSION = "v1.2.0-rc5"; } diff --git a/src/src.ino b/src/src.ino index f0f8c46..196abca 100644 --- a/src/src.ino +++ b/src/src.ino @@ -37,7 +37,7 @@ void setup() { digitalWrite(LED_BUILTIN, LOW); rgb.startFromStorage(); - rgb.run(); + // rgb.run(); // TODO: activate Serial with env Serial.begin(115200);