hueplusplus  1.0.0
Public Member Functions | Protected Attributes | List of all members
hueplusplus::CreateSensor Class Reference

Parameters for creating a new Sensor. More...

#include <hueplusplus/Sensor.h>

Public Member Functions

 CreateSensor (const std::string &name, const std::string &modelid, const std::string &swversion, const std::string &type, const std::string &uniqueid, const std::string &manufacturername)
 Construct with necessary parameters. More...
 
CreateSensorsetState (const nlohmann::json &state)
 Set state object. More...
 
CreateSensorsetConfig (const nlohmann::json &config)
 Set config object. More...
 
CreateSensorsetRecycle (bool recycle)
 Enable recycling, delete automatically when not referenced. More...
 
nlohmann::json getRequest () const
 Get request to create the sensor. More...
 

Protected Attributes

nlohmann::json request
 

Detailed Description

Parameters for creating a new Sensor.

Can be used like a builder object with chained calls.

Constructor & Destructor Documentation

◆ CreateSensor()

hueplusplus::CreateSensor::CreateSensor ( const std::string &  name,
const std::string &  modelid,
const std::string &  swversion,
const std::string &  type,
const std::string &  uniqueid,
const std::string &  manufacturername 
)

Construct with necessary parameters.

Parameters
nameHuman readable name
modelidModel id of the sensor
swversionSoftware version, may be empty
typeSensor type name (see types in Sensors)
uniqueidGlobally unique ID (MAC address of the device, extended with a unique endpoint id)
manufacturernameName of the device manufacturer

Member Function Documentation

◆ getRequest()

nlohmann::json hueplusplus::CreateSensor::getRequest ( ) const

Get request to create the sensor.

Returns
JSON request for a POST to create the new sensor

◆ setConfig()

CreateSensor & hueplusplus::CreateSensor::setConfig ( const nlohmann::json &  config)

Set config object.

Parameters
configSensor config, configs depend on the type. See getters in Sensor for examples.
Returns
this object for chaining calls

◆ setRecycle()

CreateSensor & hueplusplus::CreateSensor::setRecycle ( bool  recycle)

Enable recycling, delete automatically when not referenced.

Returns
this object for chaining calls

◆ setState()

CreateSensor & hueplusplus::CreateSensor::setState ( const nlohmann::json &  state)

Set state object.

Parameters
stateSensor state, contents depend on the type.
Returns
this object for chaining calls

Member Data Documentation

◆ request

nlohmann::json hueplusplus::CreateSensor::request
protected

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