diff --git a/src/LedManager.cpp b/src/LedManager.cpp index 80e0da3..6146b15 100644 --- a/src/LedManager.cpp +++ b/src/LedManager.cpp @@ -20,6 +20,13 @@ public: _timers->add(id, [&]() { leds->off(); }); } + void loop() { + for (auto iterator = _leds.begin(); iterator != _leds.end(); ++iterator) { + auto leds = iterator->second; + leds->loop(); + } + } + void setLedProperties(int id, bool on, float brightness, unsigned long timer) { if (!_leds.count(id)) return; diff --git a/src/main.cpp b/src/main.cpp index c9d18a8..5731405 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,9 +56,5 @@ void setup() { void loop() { _timers.loop(); - _seatingLeds.loop(); - _kitchenLeds.loop(); - _bathroomLeds.loop(); - _awningLeds.loop(); - _cabLeds.loop(); + _leds.loop(); }