hueplusplus  1.0.0
Public Member Functions | List of all members
hueplusplus::time::TimeInterval Class Reference

Time interval repeated daily to weekly. More...

#include <hueplusplus/TimePattern.h>

Public Member Functions

 TimeInterval (clock::duration start, clock::duration end, Weekdays days=Weekdays::all())
 Create time interval. More...
 
clock::duration getStartTime () const
 Get start time of the interval. More...
 
clock::duration getEndTime () const
 Get end time of the interval. More...
 
Weekdays getWeekdays () const
 Get active days. More...
 
std::string toString () const
 Get formatted string as expected by Hue API. More...
 

Detailed Description

Time interval repeated daily to weekly.

Can be used to represent an interval of time on one or multiple days per week. The maximum interval length is 23 hours.

Constructor & Destructor Documentation

◆ TimeInterval()

hueplusplus::time::TimeInterval::TimeInterval ( clock::duration  start,
clock::duration  end,
Weekdays  days = Weekdays::all() 
)

Create time interval.

Parameters
startStart time, duration from the start of the day
endEnd time, duration from the start of the day
daysActive days, optional. Defaults to daily repetition.

Member Function Documentation

◆ getEndTime()

system_clock::duration hueplusplus::time::TimeInterval::getEndTime ( ) const

Get end time of the interval.

◆ getStartTime()

system_clock::duration hueplusplus::time::TimeInterval::getStartTime ( ) const

Get start time of the interval.

◆ getWeekdays()

Weekdays hueplusplus::time::TimeInterval::getWeekdays ( ) const

Get active days.

◆ toString()

std::string hueplusplus::time::TimeInterval::toString ( ) const

Get formatted string as expected by Hue API.

Returns
with daily repetition: Thh:mm:ss/Thh:mm:ss, with start time first and end time second.
with repetition that is not daily: Wbbb/Thh:mm:ss/Thh:mm:ss

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