hueplusplus  1.0.0
HueDeviceTypes.h
Go to the documentation of this file.
1 
23 #ifndef INCLUDE_HUEPLUSPLUS_HUEDEVICETYPES_H
24 #define INCLUDE_HUEPLUSPLUS_HUEDEVICETYPES_H
25 
26 #include <memory>
27 #include <string>
28 
29 #include "Light.h"
30 
31 namespace hueplusplus
32 {
34 {
35 public:
39  LightFactory(const HueCommandAPI& commands, std::chrono::steady_clock::duration refreshDuration);
40 
50  Light createLight(const nlohmann::json& lightState, int id, const std::shared_ptr<APICache>& baseCache = {});
51 
52 private:
59  ColorType getColorType(const nlohmann::json& lightState, bool hasCt) const;
60 
61 private:
62  HueCommandAPI commands;
63  std::chrono::steady_clock::duration refreshDuration;
64  std::shared_ptr<BrightnessStrategy> simpleBrightness;
65  std::shared_ptr<ColorTemperatureStrategy> simpleColorTemperature;
66  std::shared_ptr<ColorTemperatureStrategy> extendedColorTemperature;
67  std::shared_ptr<ColorHueStrategy> simpleColorHue;
68  std::shared_ptr<ColorHueStrategy> extendedColorHue;
69 };
70 } // namespace hueplusplus
71 
72 #endif
ColorType
enum that specifies the color type of all HueLights
Definition: Light.h:42
Definition: HueCommandAPI.h:37
Namespace for the hueplusplus library.
Definition: Action.h:27
LightFactory(const HueCommandAPI &commands, std::chrono::steady_clock::duration refreshDuration)
Create a factory for Lights.
Definition: HueDeviceTypes.cpp:62
Definition: HueDeviceTypes.h:33
Light createLight(const nlohmann::json &lightState, int id, const std::shared_ptr< APICache > &baseCache={})
Create a Light with the correct type from the JSON state.
Definition: HueDeviceTypes.cpp:72
Class for Hue Light fixtures.
Definition: Light.h:60