Loading...
Searching...
No Matches
hueplusplus::ColorTemperatureStrategy Class Referenceabstract

Virtual base class for all ColorTemperatureStrategies. More...

`#include <hueplusplus/ColorTemperatureStrategy.h>`

Inheritance diagram for hueplusplus::ColorTemperatureStrategy:
[legend]

## Public Member Functions

virtual bool | setColorTemperature (unsigned int mired, uint8_t transition, Light &light) const =0
| Virtual function for changing a lights color temperature in mired with a specified transition.
virtual bool | alertTemperature (unsigned int mired, Light &light) const =0
| Virtual function that lets the light perform one breath cycle in the specified color.
virtual unsigned int | getColorTemperature (Light &light) const =0
| Virtual function that returns the current color temperature of the light.
virtual unsigned int | getColorTemperature (const Light &light) const =0
| Virtual function that returns the current color temperature of the light.
virtual | ~ColorTemperatureStrategy ()=default
| Virtual dtor.

## Detailed Description

Virtual base class for all ColorTemperatureStrategies.

## Constructor & Destructor Documentation

## ~ColorTemperatureStrategy()

virtual hueplusplus::ColorTemperatureStrategy::~ColorTemperatureStrategy | ( |  | ) |

virtual default

Virtual dtor.

## Member Function Documentation

## alertTemperature()

virtual bool hueplusplus::ColorTemperatureStrategy::alertTemperature | ( | unsigned int | mired,
|  | Light & | light
| ) |  | const

pure virtual

Virtual function that lets the light perform one breath cycle in the specified color.

The color temperature in mired ranges from 153 to 500 whereas 153 is cold and 500 is warm.

Parameters

  mired | The color temperature in mired
  light | A reference of the light

Implemented in hueplusplus::ExtendedColorTemperatureStrategy, and hueplusplus::SimpleColorTemperatureStrategy.

## getColorTemperature() [1/2]

virtual unsigned int hueplusplus::ColorTemperatureStrategy::getColorTemperature | ( | const Light & | light | ) | const

pure virtual

Virtual function that returns the current color temperature of the light.

The color temperature in mired ranges from 153 to 500 whereas 153 is cold and 500 is warm.

Note
  This should not update the lights state

Parameters

  light | A const reference of the light

Returns
  Unsigned int representing the color temperature in mired

Implemented in hueplusplus::SimpleColorTemperatureStrategy.

## getColorTemperature() [2/2]

virtual unsigned int hueplusplus::ColorTemperatureStrategy::getColorTemperature | ( | Light & | light | ) | const

pure virtual

Virtual function that returns the current color temperature of the light.

Should update the lights state by calling refreshState() The color temperature in mired ranges from 153 to 500 whereas 153 is cold and 500 is warm.

Parameters

  light | A reference of the light

Returns
  Unsigned int representing the color temperature in mired

Implemented in hueplusplus::SimpleColorTemperatureStrategy.

## setColorTemperature()

virtual bool hueplusplus::ColorTemperatureStrategy::setColorTemperature | ( | unsigned int | mired,
|  | uint8_t | transition,
|  | Light & | light
| ) |  | const

pure virtual

Virtual function for changing a lights color temperature in mired with a specified transition.

The color temperature in mired ranges from 153 to 500 whereas 153 is cold and 500 is warm.

Parameters

  mired | The color temperature in mired
  transition | The time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleColorTemperatureStrategy.

The documentation for this class was generated from the following file:

- include/hueplusplus/ColorTemperatureStrategy.h