Use LedManager to call loop function on Leds

This commit is contained in:
Robert Marshall 2022-08-19 07:27:50 +01:00
parent 6b600e021e
commit c7cf91a412
2 changed files with 8 additions and 5 deletions

View file

@ -20,6 +20,13 @@ public:
_timers->add(id, [&]() { leds->off(); }); _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) { void setLedProperties(int id, bool on, float brightness, unsigned long timer) {
if (!_leds.count(id)) if (!_leds.count(id))
return; return;

View file

@ -56,9 +56,5 @@ void setup() {
void loop() { void loop() {
_timers.loop(); _timers.loop();
_seatingLeds.loop(); _leds.loop();
_kitchenLeds.loop();
_bathroomLeds.loop();
_awningLeds.loop();
_cabLeds.loop();
} }