22 #ifndef INCLUDE_HUEPLUSPLUS_SCENE_H 23 #define INCLUDE_HUEPLUSPLUS_SCENE_H 29 #include <json/json.hpp> 43 explicit LightState(
const nlohmann::json& state);
83 nlohmann::json
toJson()
const;
109 nlohmann::json state;
129 Scene(
const std::string&
id,
const std::shared_ptr<APICache>& baseCache);
135 Scene(
const std::string&
id,
const HueCommandAPI& commands, std::chrono::steady_clock::duration refreshDuration,
const nlohmann::json& currentState);
144 void refresh(
bool force =
false);
148 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
151 std::string getId()
const;
155 std::string getName()
const;
163 void setName(
const std::string& name);
167 Type getType()
const;
171 int getGroupId()
const;
176 std::vector<int> getLightIds()
const;
185 void setLightIds(
const std::vector<int>& ids);
188 std::string getOwner()
const;
190 bool getRecycle()
const;
192 bool isLocked()
const;
195 std::string getAppdata()
const;
197 int getAppdataVersion()
const;
205 void setAppdata(
const std::string& data,
int version);
210 std::string getPicture()
const;
216 int getVersion()
const;
220 std::map<int, LightState> getLightStates()
const;
228 void setLightStates(
const std::map<int, LightState>& states);
235 void storeCurrentLightState();
242 void storeCurrentLightState(
int transition);
257 void sendPutRequest(
const std::string& path,
const nlohmann::json& request,
FileInfo fileInfo);
282 CreateScene& setLightIds(
const std::vector<int>& ids);
289 CreateScene& setAppdata(
const std::string& data,
int version);
294 CreateScene& setLightStates(
const std::map<int, LightState>& states);
298 nlohmann::json getRequest()
const;
301 nlohmann::json request;
Type
Type of the scen.
Definition: Scene.h:119
bool hasBrightness() const
Get whether a brightness is stored.
Definition: Scene.cpp:34
Definition: HueCommandAPI.h:37
bool isOn() const
Get whether the light is on.
Definition: Scene.cpp:29
int getTransitionTime() const
Get transition time to this light state.
Definition: Scene.cpp:85
Namespace for the hueplusplus library.
Definition: Action.h:27
Caches API GET requests and refreshes regularly.
Definition: APICache.h:37
bool operator==(const LightState &other) const
Equality comparison.
Definition: Scene.cpp:95
bool hasHueSat() const
Get whether hue and saturation is stored.
Definition: Scene.cpp:44
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition: HueException.h:34
Parameters for creating a new Scene.
Definition: Scene.h:267
One-time, absolute time point.
Definition: TimePattern.h:72
int getCt() const
Get color temperature of the light.
Definition: Scene.cpp:70
Color and brightness in CIE.
Definition: ColorUnits.h:62
int getBrightness() const
Get brightness of the light.
Definition: Scene.cpp:39
bool getColorloop() const
Get whether colorloop effect is active.
Definition: Scene.cpp:80
bool hasEffect() const
Get whether effect is stored.
Definition: Scene.cpp:75
nlohmann::json toJson() const
Convert to json representation.
Definition: Scene.cpp:90
Color in CIE x and y coordinates.
Definition: ColorUnits.h:47
bool operator!=(const LightState &other) const
Inequality comparison.
Definition: Scene.cpp:100
HueSaturation getHueSat() const
Get hue and saturation of the light.
Definition: Scene.cpp:49
Immutable state of a light.
Definition: Scene.h:38
bool hasXY() const
Get whether xy color is stored.
Definition: Scene.cpp:54
Builder to create LightState.
Definition: Scene.h:95
Color in hue and saturation.
Definition: ColorUnits.h:31
LightState(const nlohmann::json &state)
Create LightState from json.
Definition: Scene.cpp:27
bool hasCt() const
Get whether color temperature is stored.
Definition: Scene.cpp:65
Scene stored in the bridge.
Definition: Scene.h:115
XYBrightness getXY() const
Get xy color of the light.
Definition: Scene.cpp:59