From e1e443e42ce62bd943bf044c792fdf141b9f5f32 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 9 Mar 2017 20:38:24 +0100 Subject: [PATCH] LEDOff: Always set everything to off While it was a neat optimization to only turn LEDs off at init time, that is not enough if there are other plugins in play, that work with the LEDs independently of the active LED mode. Such a plugin is LED-ActiveModColor, which never turns LEDs off, and relies on the LED mode to do that. Since LEDOff did not turn things off on update(), when used together with LED-ActiveModColor, the LEDs under the modifiers stayed active, even after the modifiers went inactive. With this simple change, LEDOff will now update, and the problem's gone. Signed-off-by: Gergely Nagy --- src/LED-Off.cpp | 4 ++++ src/LED-Off.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/LED-Off.cpp b/src/LED-Off.cpp index b2c91c55..fa35f8bd 100644 --- a/src/LED-Off.cpp +++ b/src/LED-Off.cpp @@ -1,3 +1,7 @@ #include "LED-Off.h" +void LEDOff_::update (void) { + LEDControl.set_all_leds_to ({0, 0, 0}); +} + LEDOff_ LEDOff; diff --git a/src/LED-Off.h b/src/LED-Off.h index 6ea7ca6d..92d041e0 100644 --- a/src/LED-Off.h +++ b/src/LED-Off.h @@ -5,6 +5,8 @@ class LEDOff_ : public LEDMode { public: LEDOff_ (void) { }; + + virtual void update (void) final; }; extern LEDOff_ LEDOff;