23#ifndef INCLUDE_HUEPLUSPLUS_HUE_LIGHT_H
24#define INCLUDE_HUEPLUSPLUS_HUE_LIGHT_H
36#include <nlohmann/json.hpp>
100 virtual bool on(uint8_t transition = 4);
110 virtual bool off(uint8_t transition = 4);
125 virtual bool isOn()
const;
448 virtual bool alert();
561 Light(
int id,
const std::shared_ptr<APICache>& baseCache);
579 std::shared_ptr<const ColorTemperatureStrategy> colorTempStrategy,
580 std::shared_ptr<const ColorHueStrategy>
colorHueStrategy, std::chrono::steady_clock::duration refreshDuration,
581 const nlohmann::json& currentState);
615 std::shared_ptr<const BrightnessStrategy>
617 std::shared_ptr<const ColorTemperatureStrategy>
619 std::shared_ptr<const ColorHueStrategy>
Base class for physical devices connected to the bridge (sensor or light).
Definition BaseDevice.h:36
Definition ExtendedColorHueStrategy.h:35
Class implementing the functions of ColorTemperatureStrategy.
Definition ExtendedColorTemperatureStrategy.h:33
Definition HueCommandAPI.h:38
Definition HueDeviceTypes.h:34
Class for Hue Light fixtures.
Definition Light.h:61
virtual bool setColorHue(uint16_t hue, uint8_t transition=4)
Function to set the color of this light with specified hue.
Definition Light.h:273
virtual bool setColorSaturation(uint8_t sat, uint8_t transition=4)
Function to set the color of this light with specified saturation.
Definition Light.h:294
virtual bool alertXY(const XYBrightness &xy)
Function that lets the light perform one breath cycle in specified color.
Definition Light.h:501
virtual bool setBrightness(unsigned int bri, uint8_t transition=4)
Function that sets the brightness of this light.
Definition Light.h:158
virtual void setColorTemperatureStrategy(std::shared_ptr< const ColorTemperatureStrategy > strat)
Protected function that sets the colorTemperature strategy.
Definition Light.h:598
virtual XYBrightness getColorXY() const
Const function that returns the current color of the light as xy.
Definition Light.h:390
virtual bool isOn()
Function to check whether a light is on or off.
Definition Light.cpp:44
virtual bool setColorHueSaturation(const HueSaturation &hueSat, uint8_t transition=4)
Function to set the color of this light with specified hue and saturation.
Definition Light.h:315
virtual StateTransaction transaction()
Create a transaction for this light.
Definition Light.cpp:100
virtual XYBrightness getColorXY()
Function that returns the current color of the light as xy.
Definition Light.h:409
virtual bool setColorRGB(const RGB &rgb, uint8_t transition=4)
Function to set the color of this light with red green and blue values.
Definition Light.h:431
virtual bool alertHueSaturation(const HueSaturation &hueSat)
Function that lets the light perform one breath cycle in specified color.
Definition Light.h:481
virtual bool hasTemperatureControl() const
Const function to check whether this light has color temperature control.
Definition Light.h:138
std::shared_ptr< const ColorHueStrategy > colorHueStrategy
holds a reference to the strategy that handles all color commands
Definition Light.h:620
virtual bool off(uint8_t transition=4)
Function that turns the light off.
Definition Light.cpp:39
virtual bool setColorTemperature(unsigned int mired, uint8_t transition=4)
Function that sets the color temperature of this light in mired.
Definition Light.h:213
virtual bool hasColorControl() const
Connst function to check whether this light has full color control.
Definition Light.h:144
virtual void setColorHueStrategy(std::shared_ptr< const ColorHueStrategy > strat)
Protected function that sets the colorHue strategy.
Definition Light.h:607
ColorType colorType
holds the ColorType of the light
Definition Light.h:613
virtual bool alert()
Function that lets the light perform one breath cycle.
Definition Light.cpp:95
virtual HueSaturation getColorHueSaturation()
Function that returns the current color of the light as hue and saturation.
Definition Light.h:355
virtual unsigned int getBrightness() const
Const function that returns the brightness of this light.
Definition Light.h:173
virtual bool setColorXY(const XYBrightness &xy, uint8_t transition=4)
Function to set the color of this light in CIE with specified x y.
Definition Light.h:375
ColorGamut getColorGamut() const
Get gamut space of possible light colors.
Definition Light.cpp:64
virtual unsigned int getColorTemperature() const
Const function that returns the current color temperature of the light.
Definition Light.h:231
virtual bool on(uint8_t transition=4)
Function that turns the light on.
Definition Light.cpp:34
virtual unsigned int getColorTemperature()
Function that returns the current color temperature of the light.
Definition Light.h:252
virtual ColorType getColorType() const
Const function that returns the color type of the light.
Definition Light.cpp:59
std::shared_ptr< const ColorTemperatureStrategy > colorTemperatureStrategy
holds a reference to the strategy that handles colortemperature commands
Definition Light.h:618
virtual unsigned int getBrightness()
Function that returns the brightness of this light.
Definition Light.h:192
virtual bool setColorLoop(bool on)
Function to turn colorloop effect on/off.
Definition Light.h:525
virtual bool alertTemperature(unsigned int mired)
Function that lets the light perform one breath cycle in specified color temperature.
Definition Light.h:461
virtual HueSaturation getColorHueSaturation() const
Const function that returns the current color of the light as hue and saturation.
Definition Light.h:335
virtual void setBrightnessStrategy(std::shared_ptr< const BrightnessStrategy > strat)
Protected function that sets the brightness strategy.
Definition Light.h:588
virtual bool hasBrightnessControl() const
Const function to check whether this light has brightness control.
Definition Light.h:131
std::shared_ptr< const BrightnessStrategy > brightnessStrategy
holds a reference to the strategy that handles brightness commands
Definition Light.h:616
virtual std::string getLuminaireUId() const
Const function that returns the luminaireuniqueid of the light.
Definition Light.cpp:54
Class implementing the functions of BrightnessStrategy.
Definition SimpleBrightnessStrategy.h:33
Definition SimpleColorHueStrategy.h:35
Class implementing the functions of ColorTemperatureStrategy.
Definition SimpleColorTemperatureStrategy.h:33
Transaction class which can be used for either light or group state.
Definition StateTransaction.h:62
Namespace for the hueplusplus library.
Definition Action.h:28
ColorType
enum that specifies the color type of all HueLights
Definition Light.h:43
@ UNDEFINED
ColorType for this light is unknown or undefined.
@ GAMUT_A_TEMPERATURE
light uses Gamut A and has color temperature control
@ GAMUT_OTHER_TEMPERATURE
light uses capabilities to specify a different gamut and has color temperature control
@ NONE
light has no specific ColorType
@ TEMPERATURE
light has color temperature control
@ GAMUT_B
light uses Gamut B
@ GAMUT_A
light uses Gamut A
@ GAMUT_B_TEMPERATURE
light uses Gamut B and has color temperature control
@ GAMUT_C_TEMPERATURE
light uses Gamut C and has color temperature control
@ GAMUT_OTHER
light uses capabilities to specify a different gamut
@ GAMUT_C
light uses Gamut C
Triangle of representable colors in CIE.
Definition ColorUnits.h:78
Color in hue and saturation.
Definition ColorUnits.h:32
Color in RGB.
Definition ColorUnits.h:110
XYBrightness toXY() const
Convert to XYBrightness without clamping.
Definition ColorUnits.cpp:109
Color and brightness in CIE.
Definition ColorUnits.h:63