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

Class for Hue Entertainment Mode. More...

`#include <hueplusplus/EntertainmentMode.h>`

Collaboration diagram for hueplusplus::EntertainmentMode:
[legend]

## Public Member Functions

| EntertainmentMode (Bridge &b, Group &g)
| Constructor.
| ~EntertainmentMode ()
| Destroy the Entertainment Mode object.
bool | connect ()
| Connect and start streaming.
bool | disconnect ()
| Disconnect and stop streaming.
bool | setColorRGB (uint8_t light_index, uint8_t red, uint8_t green, uint8_t blue)
| Set the color of the given light in RGB format.
bool | update ()
| Update all set colors by setColorRGB.

## Protected Attributes

Bridge * | bridge
| Associated bridge.
Group * | group
| Associated group.
std::vector< uint8_t > | entertainment_msg
| buffer containing the entertainment mode packet data
uint8_t | entertainment_num_lights
| number of lights in entertainment mode group
std::unique_ptr< TLSContext > | tls_context
| tls context

## Detailed Description

Class for Hue Entertainment Mode.

Provides methods to initialize and control Entertainment groups.

## Constructor & Destructor Documentation

## EntertainmentMode()

hueplusplus::EntertainmentMode::EntertainmentMode | ( | Bridge & | b,
|  | Group & | g
| ) |  |

Constructor.

Parameters

  b | Bridge reference
  g | Group to control in entertainment mode reference

Note
  References are held to both `b` and `g`. They must stay valid until EntertainmentMode ist destroyed.

## ~EntertainmentMode()

hueplusplus::EntertainmentMode::~EntertainmentMode | ( |  | ) |

Destroy the Entertainment Mode object.

## Member Function Documentation

## connect()

bool hueplusplus::EntertainmentMode::connect | ( |  | ) |

Connect and start streaming.

Returns
  true If conected and ready to receive commands
  false If an error occured

## disconnect()

bool hueplusplus::EntertainmentMode::disconnect | ( |  | ) |

Disconnect and stop streaming.

Returns
  true If disconnected successfully
  false If an error occurred

## setColorRGB()

bool hueplusplus::EntertainmentMode::setColorRGB | ( | uint8_t | light_index,
|  | uint8_t | red,
|  | uint8_t | green,
|  | uint8_t | blue
| ) |  |

Set the color of the given light in RGB format.

Parameters

  light_index | Light index inside the group
  red | Red color value (0-255)
  green | Green color value (0-255)
  blue | Blue color value (0-255)

Returns
  true If light_index was valid
  false If light_index was invalid

## update()

bool hueplusplus::EntertainmentMode::update | ( |  | ) |

Update all set colors by setColorRGB.

Returns
  true If all color values for all lights have ben written/sent
  false If there was an error while writing

## Member Data Documentation

## bridge

Bridge* hueplusplus::EntertainmentMode::bridge

protected

Associated bridge.

## entertainment_msg

std::vector<uint8_t> hueplusplus::EntertainmentMode::entertainment_msg

protected

buffer containing the entertainment mode packet data

## entertainment_num_lights

uint8_t hueplusplus::EntertainmentMode::entertainment_num_lights

protected

number of lights in entertainment mode group

## group

Group* hueplusplus::EntertainmentMode::group

protected

Associated group.

## tls_context

std::unique_ptr<TLSContext> hueplusplus::EntertainmentMode::tls_context

protected

tls context

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

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