3 #include "../EventLimiter.h"
4 #include "../SinricProStrings.h"
6 #include "../SinricProNamespace.h"
7 namespace SINRICPRO_NAMESPACE {
9 FSTR(PUSHNOTIFICATION, pushNotification);
10 FSTR(PUSHNOTIFICATION, alert);
22 EventLimiter event_limiter;
27 : event_limiter (EVENT_LIMIT_SENSOR_VALUE) {}
39 if (event_limiter)
return false;
40 T* device =
static_cast<T*
>(
this);
42 JsonDocument eventMessage = device->prepareEvent(FSTR_PUSHNOTIFICATION_pushNotification, FSTR_SINRICPRO_ALERT);
43 JsonObject event_value = eventMessage[FSTR_SINRICPRO_payload][FSTR_SINRICPRO_value];
45 event_value[FSTR_PUSHNOTIFICATION_alert] = notification;
47 return device->sendEvent(eventMessage);
53 using PushNotification = SINRICPRO_NAMESPACE::PushNotification<T>;
PushNotification.
Definition: PushNotification.h:17
bool sendPushNotification(String notification)
Sending push notifications to SinricPro App.
Definition: PushNotification.h:38