Loading...
Searching...
No Matches
hueplusplus::SimpleColorTemperatureStrategy Class Reference

Class implementing the functions of ColorTemperatureStrategy. More...

`#include <hueplusplus/SimpleColorTemperatureStrategy.h>`

Inheritance diagram for hueplusplus::SimpleColorTemperatureStrategy:
[legend]
Collaboration diagram for hueplusplus::SimpleColorTemperatureStrategy:
[legend]

## Public Member Functions

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

## Detailed Description

Class implementing the functions of ColorTemperatureStrategy.

## Member Function Documentation

## alertTemperature()

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

override virtual

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

It uses this_thread::sleep_for to accomodate for the time an Light::alert() needs 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

Implements hueplusplus::ColorTemperatureStrategy.

## getColorTemperature() [1/2]

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

override 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 does not update the lights state

Parameters

  light | A const reference of the light

Returns
  Unsigned int representing the color temperature in mired

Implements hueplusplus::ColorTemperatureStrategy.

## getColorTemperature() [2/2]

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

override virtual

Function that returns the current color temperature of the light.

Updates 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

Implements hueplusplus::ColorTemperatureStrategy.

## setColorTemperature()

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

override 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

Implements hueplusplus::ColorTemperatureStrategy.

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

- include/hueplusplus/SimpleColorTemperatureStrategy.h
- src/SimpleColorTemperatureStrategy.cpp