|
MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
|
Schedules light switching depending on time of day and ambient light. More...
#include <light_scheduler.h>
Public Member Functions | |
| LightScheduler (Relay *light, int start_hour, int start_min, uint64_t duration_sec) | |
| Construct a new Light Scheduler object. More... | |
| void | reset (tm *time) |
| reset start time to given time More... | |
| void | run (tm *time, bool is_bright) |
| Run this in a loop and pass the current time and a boolean indicating if its bright. More... | |
Schedules light switching depending on time of day and ambient light.
Definition at line 28 of file light_scheduler.h.
| LightScheduler::LightScheduler | ( | Relay * | light, |
| int | start_hour, | ||
| int | start_min, | ||
| uint64_t | duration_sec | ||
| ) |
Construct a new Light Scheduler object.
| light | Relay used for light |
| start_hour | start hour in 24h format |
| start_min | start min |
| duration_sec | total light duration required for the plant in seconds |
Definition at line 17 of file light_scheduler.cpp.
| void LightScheduler::reset | ( | tm * | time | ) |
reset start time to given time
| time | time vale to set to |
Definition at line 28 of file light_scheduler.cpp.
| void LightScheduler::run | ( | tm * | time, |
| bool | is_bright | ||
| ) |
Run this in a loop and pass the current time and a boolean indicating if its bright.
| time | time struct of time now |
| is_bright | boolean flag if its bright now |
Definition at line 38 of file light_scheduler.cpp.