hueplusplus
1.0.0
|
Time repeated weekly to daily, with possible random variation. More...
#include <hueplusplus/TimePattern.h>
Public Member Functions | |
RecurringTime (clock::duration daytime, Weekdays days, clock::duration variation=std::chrono::seconds(0)) | |
Create recurring time. More... | |
clock::duration | getDaytime () const |
Get time of day. More... | |
clock::duration | getRandomVariation () const |
Get random variation. More... | |
Weekdays | getWeekdays () const |
Get days on which the repetition will happen. More... | |
std::string | toString () const |
Get formatted string as expected by Hue API. More... | |
Time repeated weekly to daily, with possible random variation.
Can be used to represent a time on one or multiple days per week. It can also have a random variation of up to 12 hours.
|
explicit |
Create recurring time.
daytime | Time of day, duration from the start of the day. |
days | Days to repeat on, should not be Weekdays::none() |
variation | Random variation, optional. Must be less than 12 hours. When not zero, the time is randomly chosen between daytime - variation and daytime + variation |
system_clock::duration hueplusplus::time::RecurringTime::getDaytime | ( | ) | const |
Get time of day.
system_clock::duration hueplusplus::time::RecurringTime::getRandomVariation | ( | ) | const |
Get random variation.
The time can vary up to this amount in both directions.
Weekdays hueplusplus::time::RecurringTime::getWeekdays | ( | ) | const |
Get days on which the repetition will happen.
std::string hueplusplus::time::RecurringTime::toString | ( | ) | const |
Get formatted string as expected by Hue API.
bbb
/Thh:mm:ss
bbb
/Thh:mm:ss
Ahh:mm:ss
, where daytime is first and variation is second.