8 #ifndef _SINRICMOTIONSENSOR_H_
9 #define _SINRICMOTIONSENSOR_H_
11 #include "SinricProDevice.h"
20 String getProductType() {
return SinricProDevice::getProductType() + String(
"MOTION_SENSOR"); }
23 bool sendMotionEvent(
bool detected, String cause =
"PHYSICAL_INTERACTION");
27 SinricProMotionsensor::SinricProMotionsensor(
const char* deviceId,
unsigned long eventWaitTime) :
SinricProDevice(deviceId, eventWaitTime) {}
39 DynamicJsonDocument eventMessage = prepareEvent(deviceId,
"motion", cause.c_str());
40 JsonObject event_value = eventMessage[
"payload"][
"value"];
41 event_value[
"state"] = state?
"detected":
"notDetected";
42 return sendEvent(eventMessage);