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

Virtual base class for all BrightnessStrategies. More...

`#include <hueplusplus/BrightnessStrategy.h>`

Inheritance diagram for hueplusplus::BrightnessStrategy:
[legend]

## Public Member Functions

virtual bool | setBrightness (unsigned int bri, uint8_t transition, Light &light) const =0
| Virtual function for changing a lights brightness with a specified transition.
virtual unsigned int | getBrightness (Light &light) const =0
| Virtual function that returns the current brightnessof the light.
virtual unsigned int | getBrightness (const Light &light) const =0
| Virtual function that returns the current brightness of the light.
virtual | ~BrightnessStrategy ()=default
| Virtual dtor.

## Detailed Description

Virtual base class for all BrightnessStrategies.

## Constructor & Destructor Documentation

## ~BrightnessStrategy()

virtual hueplusplus::BrightnessStrategy::~BrightnessStrategy | ( |  | ) |

virtual default

Virtual dtor.

## Member Function Documentation

## getBrightness() [1/2]

virtual unsigned int hueplusplus::BrightnessStrategy::getBrightness | ( | const Light & | light | ) | const

pure virtual

Virtual function that returns the current brightness of the light.

Note
  This should not update the lights state

Parameters

  light | A const reference of the light

Returns
  Unsigned int representing the brightness

Implemented in hueplusplus::SimpleBrightnessStrategy.

## getBrightness() [2/2]

virtual unsigned int hueplusplus::BrightnessStrategy::getBrightness | ( | Light & | light | ) | const

pure virtual

Virtual function that returns the current brightnessof the light.

Should update the lights state by calling refreshState()

Parameters

  light | A reference of the light

Returns
  Unsigned int representing the brightness

Implemented in hueplusplus::SimpleBrightnessStrategy.

## setBrightness()

virtual bool hueplusplus::BrightnessStrategy::setBrightness | ( | unsigned int | bri,
|  | uint8_t | transition,
|  | Light & | light ) const

pure virtual

Virtual function for changing a lights brightness with a specified transition.

Parameters

  bri | The brightness raning from 0 = off to 255 = fully lit
  transition | The time it takes to fade to the new brightness in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleBrightnessStrategy.

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

- include/hueplusplus/BrightnessStrategy.h