Loading...
Searching...
No Matches
HueDeviceTypes.h
Go to the documentation of this file.
#ifndef INCLUDE_HUEPLUSPLUS_HUEDEVICETYPES_H
#define INCLUDE_HUEPLUSPLUS_HUEDEVICETYPES_H
#include <memory>
#include <string>
#include "Light.h"
namespace hueplusplus
{
class LightFactory
{
public:
LightFactory(const HueCommandAPI& commands, std::chrono::steady_clock::duration refreshDuration);
Light createLight(const nlohmann::json& lightState, int id, const std::shared_ptr<APICache>& baseCache = {});
private:
ColorType getColorType(const nlohmann::json& lightState, bool hasCt) const;
private:
HueCommandAPI commands;
std::chrono::steady_clock::duration refreshDuration;
std::shared_ptr<BrightnessStrategy> simpleBrightness;
std::shared_ptr<ColorTemperatureStrategy> simpleColorTemperature;
std::shared_ptr<ColorTemperatureStrategy> extendedColorTemperature;
std::shared_ptr<ColorHueStrategy> simpleColorHue;
std::shared_ptr<ColorHueStrategy> extendedColorHue;
};
} // namespace hueplusplus
#endif
Light.h
hueplusplus::HueCommandAPI
Definition HueCommandAPI.h:38
hueplusplus::LightFactory
Definition HueDeviceTypes.h:34
hueplusplus::LightFactory::createLight
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
hueplusplus::Light
Class for Hue Light fixtures.
Definition Light.h:61
hueplusplus
Namespace for the hueplusplus library.
Definition Action.h:28
hueplusplus::ColorType
ColorType
enum that specifies the color type of all HueLights
Definition Light.h:43