8 #ifndef _SINRICAIRQUALITYSENSOR_H_
9 #define _SINRICAIRQUALITYSENSOR_H_
11 #include "SinricProDevice.h"
20 String getProductType() {
return SinricProDevice::getProductType() + String(
"AIR_QUALITY_SENSOR"); }
23 bool sendAirQualityEvent(
int pm1=0,
int pm2_5=0,
int pm10=0, String cause =
"PERIODIC_POLL");
27 SinricProAirQualitySensor::SinricProAirQualitySensor(
const char* deviceId,
unsigned long eventWaitTime) :
SinricProDevice(deviceId, eventWaitTime) {}
41 DynamicJsonDocument eventMessage = prepareEvent(deviceId,
"airQuality", cause.c_str());
42 JsonObject event_value = eventMessage[
"payload"][
"value"];
44 event_value[
"pm1"] = limitValue(pm1, 0, 999);
45 event_value[
"pm2_5"] = limitValue(pm2_5, 0, 999);
46 event_value[
"pm10"] = limitValue(pm10, 0, 999);
48 return sendEvent(eventMessage);