22#ifndef INCLUDE_HUEPLUSPLUS_SCHEDULE_H
23#define INCLUDE_HUEPLUSPLUS_SCHEDULE_H
40 Schedule(
int id,
const std::shared_ptr<APICache>& baseCache);
46 Schedule(
int id,
const HueCommandAPI& commands, std::chrono::steady_clock::duration refreshDuration,
const nlohmann::json& currentState);
95 void setName(
const std::string& name);
140 void sendPutRequest(
const nlohmann::json& request,
FileInfo fileInfo);
181 nlohmann::json request;
Caches API GET requests and refreshes regularly.
Definition APICache.h:38
Action executed by the bridge, e.g. as a Schedule command.
Definition Action.h:36
Parameters for creating a new Schedule.
Definition Schedule.h:151
CreateSchedule & setName(const std::string &name)
Set name.
Definition Schedule.cpp:147
CreateSchedule & setTime(const time::TimePattern &time)
Set time.
Definition Schedule.cpp:165
CreateSchedule & setCommand(const Action &command)
Set command.
Definition Schedule.cpp:159
nlohmann::json getRequest() const
Get request to create the schedule.
Definition Schedule.cpp:189
CreateSchedule & setRecycle(bool recycle)
Set recycle.
Definition Schedule.cpp:183
CreateSchedule & setDescription(const std::string &description)
Set description.
Definition Schedule.cpp:153
CreateSchedule & setStatus(bool enabled)
Set status.
Definition Schedule.cpp:171
CreateSchedule & setAutodelete(bool autodelete)
Set autodelete.
Definition Schedule.cpp:177
Definition HueCommandAPI.h:38
Schedule stored in the bridge.
Definition Schedule.h:35
void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration)
Sets custom refresh interval for this schedule.
Definition Schedule.cpp:42
Action getCommand() const
Get schedule command.
Definition Schedule.cpp:62
void refresh()
Refreshes internal cached state.
Definition Schedule.cpp:37
int getId() const
Get schedule identifier.
Definition Schedule.cpp:47
time::AbsoluteTime getStartTime() const
Get start time for timers.
Definition Schedule.cpp:93
void setEnabled(bool enabled)
Enable or disable schedule.
Definition Schedule.cpp:130
void setAutodelete(bool autodelete)
Set autodelete.
Definition Schedule.cpp:136
void setName(const std::string &name)
Set schedule name.
Definition Schedule.cpp:98
std::string getName() const
Get schedule name.
Definition Schedule.cpp:52
time::AbsoluteTime getCreated() const
Get created time.
Definition Schedule.cpp:88
bool isEnabled() const
Check whether schedule is enabled or disabled.
Definition Schedule.cpp:74
time::TimePattern getTime() const
Get time when the event(s) will occur.
Definition Schedule.cpp:67
void setCommand(const Action &command)
Set schedule command.
Definition Schedule.cpp:110
std::string getDescription() const
Get schedule description.
Definition Schedule.cpp:57
void setTime(const time::TimePattern &timePattern)
Set new time when the event will occur.
Definition Schedule.cpp:116
bool getAutodelete() const
Get autodelete.
Definition Schedule.cpp:83
void setDescription(const std::string &description)
Set schedule description.
Definition Schedule.cpp:104
One-time, absolute time point.
Definition TimePattern.h:73
Holds different time representations.
Definition TimePattern.h:352
Namespace for the hueplusplus library.
Definition Action.h:28
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition HueException.h:35