Use LedManager to call loop function on Leds
This commit is contained in:
parent
6b600e021e
commit
c7cf91a412
2 changed files with 8 additions and 5 deletions
|
@ -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;
|
||||||
|
|
|
@ -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();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue