1 #ifndef _AIRQUALITYSENSOR_H_
2 #define _AIRQUALITYSENSOR_H_
27 T& device =
static_cast<T&
>(*this);
29 DynamicJsonDocument eventMessage = device.prepareEvent(
"airQuality", cause.c_str());
30 JsonObject event_value = eventMessage[
"payload"][
"value"];
32 event_value[
"pm1"] = pm1;
33 event_value[
"pm2_5"] = pm2_5;
34 event_value[
"pm10"] = pm10;
36 return device.sendEvent(eventMessage);
AirQuality.
Definition: AirQualitySensor.h:9
bool sendAirQualityEvent(int pm1=0, int pm2_5=0, int pm10=0, String cause="PERIODIC_POLL")
Sending air quality to SinricPro server.
Definition: AirQualitySensor.h:26