SinricPro Library
DoorbellEventSource.h
1 #ifndef _DOORBELLEVENTSOURCE_H_
2 #define _DOORBELLEVENTSOURCE_H_
3 
8 template <typename T>
10  public:
11  bool sendDoorbellEvent(String cause = "PHYSICAL_INTERACTION");
12 };
13 
22 template <typename T>
24  T& device = static_cast<T&>(*this);
25 
26  DynamicJsonDocument eventMessage = device.prepareEvent("DoorbellPress", cause.c_str());
27  JsonObject event_value = eventMessage["payload"]["value"];
28  event_value["state"] = "pressed";
29  return device.sendEvent(eventMessage);
30 }
31 
32 #endif
DorbellEventSource.
Definition: DoorbellEventSource.h:9
bool sendDoorbellEvent(String cause="PHYSICAL_INTERACTION")
Send Doorbell event to SinricPro Server indicating someone pressed the doorbell button.
Definition: DoorbellEventSource.h:23