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);
178 nlohmann::json getRequest()
const;
181 nlohmann::json request;
void setName(const std::string &name)
Set schedule name.
Definition: Schedule.cpp:98
Parameters for creating a new Schedule.
Definition: Schedule.h:150
Definition: HueCommandAPI.h:37
Schedule stored in the bridge.
Definition: Schedule.h:34
void refresh()
Refreshes internal cached state.
Definition: Schedule.cpp:37
Action executed by the bridge, e.g. as a Schedule command.
Definition: Action.h:35
std::string getName() const
Get schedule name.
Definition: Schedule.cpp:52
Namespace for the hueplusplus library.
Definition: Action.h:27
void setCommand(const Action &command)
Set schedule command.
Definition: Schedule.cpp:110
Caches API GET requests and refreshes regularly.
Definition: APICache.h:37
time::AbsoluteTime getStartTime() const
Get start time for timers.
Definition: Schedule.cpp:93
Holds different time representations.
Definition: TimePattern.h:351
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition: HueException.h:34
time::AbsoluteTime getCreated() const
Get created time.
Definition: Schedule.cpp:88
One-time, absolute time point.
Definition: TimePattern.h:72
time::TimePattern getTime() const
Get time when the event(s) will occur.
Definition: Schedule.cpp:67
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 setTime(const time::TimePattern &timePattern)
Set new time when the event will occur.
Definition: Schedule.cpp:116
Schedule(int id, const std::shared_ptr< APICache > &baseCache)
Creates schedule with shared cache.
Definition: Schedule.cpp:27
void setEnabled(bool enabled)
Enable or disable schedule.
Definition: Schedule.cpp:130
std::string getDescription() const
Get schedule description.
Definition: Schedule.cpp:57
bool isEnabled() const
Check whether schedule is enabled or disabled.
Definition: Schedule.cpp:74
void setDescription(const std::string &description)
Set schedule description.
Definition: Schedule.cpp:104
int getId() const
Get schedule identifier.
Definition: Schedule.cpp:47
bool getAutodelete() const
Get autodelete.
Definition: Schedule.cpp:83
void setAutodelete(bool autodelete)
Set autodelete.
Definition: Schedule.cpp:136