MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
Public Member Functions | List of all members
LightScheduler Class Reference

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...
 

Detailed Description

Schedules light switching depending on time of day and ambient light.

Definition at line 28 of file light_scheduler.h.

Constructor & Destructor Documentation

◆ LightScheduler()

LightScheduler::LightScheduler ( Relay light,
int  start_hour,
int  start_min,
uint64_t  duration_sec 
)

Construct a new Light Scheduler object.

Parameters
lightRelay used for light
start_hourstart hour in 24h format
start_minstart min
duration_sectotal light duration required for the plant in seconds

Definition at line 17 of file light_scheduler.cpp.

Member Function Documentation

◆ reset()

void LightScheduler::reset ( tm *  time)

reset start time to given time

Parameters
timetime vale to set to

Definition at line 28 of file light_scheduler.cpp.

◆ run()

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.

Parameters
timetime struct of time now
is_brightboolean flag if its bright now

Definition at line 38 of file light_scheduler.cpp.


The documentation for this class was generated from the following files: