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(); });
}
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;