SinricPro Library
|
Device to report air quality events. More...
Public Types | |
using | PowerStateCallback = std::function< bool(const String &, bool &)> |
Callback definition for onPowerState 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... | |
bool | sendAirQualityEvent (int pm1=0, int pm2_5=0, int pm10=0, String cause="PERIODIC_POLL") |
Sending air quality to SinricPro server. More... | |
Device to report air quality events.
|
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 powerState
request.
cb | Function pointer to a PowerStateCallback function |
|
inherited |
Sending air quality to SinricPro server.
pm1 | int 1.0 μm particle pollutant in μg/m3 |
pm2_5 | int 2.5 μm particle pollutant in μg/m3 |
pm10 | int 10 μm particle pollutant in μg/m3 |
cause | (optional) String reason why event is sent (default = "PERIODIC_POLL" ) |
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 |