SinricPro Library
|
Device to turn on / off a fan and change it's speed by using powerlevel. More...
Public Types | |
using | PowerStateCallback = std::function< bool(const String &, bool &)> |
Callback definition for onPowerState function. More... | |
using | SetPowerLevelCallback = std::function< bool(const String &, int &)> |
Definition for setPowerLevel callback. More... | |
using | AdjustPowerLevelCallback = std::function< bool(const String &, int &)> |
Definition for onAdjustPowerLevel callback. 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 | onPowerLevel (SetPowerLevelCallback cb) |
Set callback function for setPowerLevel request. More... | |
void | onAdjustPowerLevel (AdjustPowerLevelCallback cb) |
Set callback function for adjustPowerLevel request. More... | |
bool | sendPowerLevelEvent (int powerLevel, String cause="PHYSICAL_INTERACTION") |
Send setPowerLevel event to SinricPro Server indicating actual power level. More... | |
Device to turn on / off a fan and change it's speed by using powerlevel.
|
inherited |
Definition for onAdjustPowerLevel callback.
Gets called when device receive a adjustPowerLevel
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | powerLevel | integer -100..100 delta value which power level have to be changed |
[out] | powerLevel | integer 0..100 report the absolute powerlevel that the device have been set to |
true | request handled properly |
false | request can`t be 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 |
Definition for setPowerLevel callback.
Gets called when device receive a setPowerLevel
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | powerLevel | integer 0..100 new powerlevel the device should be set to |
[out] | powerLevel | integer 0..100 report the powerlevel that the device have been set to |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Set callback function for adjustPowerLevel request.
cb | Function pointer to a AdjustPowerLevelCallback function |
|
inherited |
Set callback function for setPowerLevel request.
cb | Function pointer to a SetPowerLevelCallback function |
|
inherited |
Set callback function for powerState
request.
cb | Function pointer to a PowerStateCallback function |
|
inherited |
Send setPowerLevel
event to SinricPro Server indicating actual power level.
powerLevel | integer 0..100 report the powerlevel that the device have been set to |
cause | (optional) 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 |