Loading...
Searching...
No Matches
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.
clock::duration | getStartTime () const
| Get start time of the interval.
clock::duration | getEndTime () const
| Get end time of the interval.
Weekdays | getWeekdays () const
| Get active days.
std::string | toString () const
| Get formatted string as expected by Hue API.

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

  start | Start time, duration from the start of the day
  end | End time, duration from the start of the day
  days | Active 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: T `hh:mm:ss`/T `hh:mm:ss`, with start time first and end time second.
  with repetition that is not daily: W `bbb`/T `hh:mm:ss`/T `hh:mm:ss`

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

- include/hueplusplus/TimePattern.h
- src/TimePattern.cpp