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

Parameters for creating a new Scene. More...

`#include <hueplusplus/Scene.h>`

## Public Member Functions

CreateScene & | setName (const std::string &name)
| Set name.
CreateScene & | setGroupId (int id)
| Set group id, making the scene a GroupScene.
CreateScene & | setLightIds (const std::vector< int > &ids)
| Set light ids, making the scene a LightScene.
CreateScene & | setRecycle (bool recycle)
| Set whether the scene can be automatically deleted.
CreateScene & | setAppdata (const std::string &data, int version)
| Set app specific data.
CreateScene & | setLightStates (const std::map< int, LightState > &states)
| Set light states of the scene.
nlohmann::json | getRequest () const
| Get request to create the scene.

## Detailed Description

Parameters for creating a new Scene.

Can be used like a builder object with chained calls.

## Member Function Documentation

## getRequest()

nlohmann::json hueplusplus::CreateScene::getRequest | ( |  | ) | const

Get request to create the scene.

Returns
  JSON request for a POST to create the new scene

## setAppdata()

CreateScene & hueplusplus::CreateScene::setAppdata | ( | const std::string & | data,
|  | int | version
| ) |  |

Set app specific data.

See also
  Scene::setAppdata

## setGroupId()

CreateScene & hueplusplus::CreateScene::setGroupId | ( | int | id | ) |

Set group id, making the scene a GroupScene.

Parameters

  id | Group id for the scene, not 0

The group id cannot be changed after the scene was created.

Exceptions

  HueException | when used after setLightIds

## setLightIds()

CreateScene & hueplusplus::CreateScene::setLightIds | ( | const std::vector< int > & | ids | ) |

Set light ids, making the scene a LightScene.

Parameters

  ids | Ids of lights in the scene

Exceptions

  HueException | when used after setGroupId

## setLightStates()

CreateScene & hueplusplus::CreateScene::setLightStates | ( | const std::map< int, LightState > & | states | ) |

Set light states of the scene.

When omitted, the current light states are stored.

See also
  Scene::setLightStates

## setName()

CreateScene & hueplusplus::CreateScene::setName | ( | const std::string & | name | ) |

Set name.

See also
  Scene::setName

## setRecycle()

CreateScene & hueplusplus::CreateScene::setRecycle | ( | bool | recycle | ) |

Set whether the scene can be automatically deleted.

Cannot be changed after the scene was created.

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

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