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

Class implementing the functions of BrightnessStrategy. More...

`#include <hueplusplus/SimpleBrightnessStrategy.h>`

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

## Public Member Functions

bool | setBrightness (unsigned int bri, uint8_t transition, Light &light) const override
| Function for changing a lights brightness with a specified transition.
unsigned int | getBrightness (Light &light) const override
| Function that returns the current brightness of the light.
unsigned int | getBrightness (const Light &light) const override
| Function that returns the current brightness of the light.
Public Member Functions inherited from hueplusplus::BrightnessStrategy
virtual | ~BrightnessStrategy ()=default
| Virtual dtor.

## Detailed Description

Class implementing the functions of BrightnessStrategy.

## Member Function Documentation

## getBrightness() [1/2]

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

override virtual

Function that returns the current brightness of the light.

Note
  This does not update the lights state

Parameters

  light | A const reference of the light

Returns
  Unsigned int representing the brightness

Implements hueplusplus::BrightnessStrategy.

## getBrightness() [2/2]

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

override virtual

Function that returns the current brightness of the light.

Updates the lights state by calling refreshState()

Parameters

  light | A reference of the light

Returns
  Unsigned int representing the brightness

Implements hueplusplus::BrightnessStrategy.

## setBrightness()

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

override 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

Implements hueplusplus::BrightnessStrategy.

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

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