SinricPro Library
|
Device to control a light. More...
Public Types | |
using | PowerStateCallback = std::function< bool(const String &, bool &)> |
Callback definition for onPowerState function. More... | |
using | BrightnessCallback = std::function< bool(const String &, int &)> |
Callback definition for onBrightness function. More... | |
using | AdjustBrightnessCallback = std::function< bool(const String &, int &)> |
Callback definition for onAdjustBrightness function. More... | |
using | ColorCallback = std::function< bool(const String &, byte &, byte &, byte &)> |
Callback definition for onColor function. More... | |
using | ColorTemperatureCallback = std::function< bool(const String &, int &)> |
Callback definition for onColorTemperature function. More... | |
using | IncreaseColorTemperatureCallback = std::function< bool(const String &, int &)> |
Callback definition for onIncreaseColorTemperature function. More... | |
using | DecreaseColorTemperatureCallback = std::function< bool(const String &, int &)> |
Callback definition for onDecreaseColorTemperature function. More... | |
Public Member Functions | |
void | onPowerState (PowerStateCallback cb) |
Set callback function for powerState request. More... | |
bool | sendPowerStateEvent (bool state, String cause="PHYSICAL_INTERACTION") |
Send setPowerState event to SinricPro Server indicating actual power state. More... | |
void | onBrightness (BrightnessCallback cb) |
Set callback function for setBrightness request. More... | |
void | onAdjustBrightness (AdjustBrightnessCallback cb) |
Set callback function for adjustBrightness request. More... | |
bool | sendBrightnessEvent (int brightness, String cause="PHYSICAL_INTERACTION") |
Send setBrightness event to SinricPro Server indicating actual brightness. More... | |
void | onColor (ColorCallback cb) |
Set callback function for setColor request. More... | |
bool | sendColorEvent (byte r, byte g, byte b, String cause="PHYSICAL_INTERACTION") |
Send setColor event to SinricPro Server indicating actual color. More... | |
void | onColorTemperature (ColorTemperatureCallback cb) |
Set callback function for setColorTemperature request. More... | |
void | onIncreaseColorTemperature (IncreaseColorTemperatureCallback cb) |
Set callback function for increaseColorTemperature request. More... | |
void | onDecreaseColorTemperature (DecreaseColorTemperatureCallback cb) |
Set callback function for decreaseColorTemperature request. More... | |
bool | sendColorTemperatureEvent (int colorTemperature, String cause="PHYSICAL_INTERACTION") |
Send setColorTemperature event to SinricPro Server indicating actual color temperature. More... | |
Device to control a light.
Supporting
|
inherited |
Callback definition for onAdjustBrightness function.
Gets called when device receive a adjustBrightness
request
[in] | deviceId | String which contains the ID of device |
[in] | brightness | Relative integer value the device should change the brightness about |
[out] | brightness | Absolute integer value with new brightness the device is set to |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onBrightness function.
Gets called when device receive a setBrightness
request
[in] | deviceId | String which contains the ID of device |
[in] | brightness | Absolute integer value the device should set its brightness to |
[out] | brightness | Absolute integer value with new brightness the device is set to |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onColor function.
Gets called when device receive a setColor
request
[in] | deviceId | String which contains the ID of device |
[in] | r | Byte value for red |
[in] | g | Byte value for green |
[in] | b | Byte value for blue |
[out] | r | Byte value for red |
[out] | g | Byte value for green |
[out] | b | Byte value for blue |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onColorTemperature function.
Gets called when device receive a setColorTemperature
request
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value with color temperature the device should set to 2200 = warm white 2700 = soft white 4000 = white 5500 = daylight white 7000 = cool white |
[out] | colorTemperature | Integer value with color temperature the device is set to 2200 = warm white 2700 = soft white 4000 = white 5500 = daylight white 7000 = cool white |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onDecreaseColorTemperature function.
Gets called when device receive a decreaseColorTemperature
request
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value -1 = Device should decrease color temperature |
[out] | colorTemperature | Integer value return the new color temperarature 2200 = warm white 2700 = soft white 4000 = white 5500 = daylight white 7000 = cool white |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onIncreaseColorTemperature function.
Gets called when device receive a increaseColorTemperature
request
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value 1 = Device should increase color temperature |
[out] | colorTemperature | Integer value return the new color temperarature 2200 = warm white 2700 = soft white 4000 = white 5500 = daylight white 7000 = cool white |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onPowerState function.
Gets called when device receive a setPowerState
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | state | true = device is requested to turn on false = device is requested to turn off |
[out] | state | true = device has been turned on false = device has been turned off |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Set callback function for adjustBrightness
request.
cb | Function pointer to a AdjustBrightnessCallback function |
|
inherited |
Set callback function for setBrightness
request.
cb | Function pointer to a BrightnessCallback function |
|
inherited |
Set callback function for setColor
request.
cb | Function pointer to a ColorCallback function |
|
inherited |
Set callback function for setColorTemperature
request.
cb | Function pointer to a ColorTemperatureCallback function |
|
inherited |
Set callback function for decreaseColorTemperature
request.
cb | Function pointer to a DecreaseColorTemperatureCallback function |
|
inherited |
Set callback function for increaseColorTemperature
request.
cb | Function pointer to a IncreaseColorTemperatureCallback function |
|
inherited |
Set callback function for powerState
request.
cb | Function pointer to a PowerStateCallback function |
|
inherited |
Send setBrightness
event to SinricPro Server indicating actual brightness.
brightness | Integer value with actual brightness the device is set to |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
|
inherited |
Send setColor
event to SinricPro Server indicating actual color.
r | Byte value for red |
g | Byte value for green |
b | Byte value for blue |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
|
inherited |
Send setColorTemperature
event to SinricPro Server indicating actual color temperature.
colorTemperature | Integer with new color temperature the device is set to 2200 = warm white 2700 = soft white 4000 = white 5500 = daylight white 7000 = cool white |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
|
inherited |
Send setPowerState
event to SinricPro Server indicating actual power state.
state | true = device turned on false = device turned off |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |