14#define LOG_EVENT(prefix, type, obj) \
15 if ((obj) != nullptr) { \
16 ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
17 if (!(obj)->get_icon_ref().empty()) { \
18 ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon_ref().c_str()); \
20 if (!(obj)->get_device_class_ref().empty()) { \
21 ESP_LOGCONFIG(TAG, "%s Device Class: '%s'", prefix, (obj)->get_device_class_ref().c_str()); \
27 void trigger(
const std::string &event_type);
31 this->
types_ = event_types;
32 this->last_event_type_ =
nullptr;
59 const char *last_event_type_{
nullptr};
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
void set_event_types(std::initializer_list< const char * > event_types)
Set the event types supported by this event (from initializer list).
void set_event_types(std::initializer_list< std::string > event_types)=delete
const FixedVector< const char * > & get_event_types() const
Return the event types supported by this event.
void set_event_types(const FixedVector< std::string > &event_types)=delete
void trigger(const std::string &event_type)
void add_on_event_callback(std::function< void(const std::string &event_type)> &&callback)
FixedVector< const char * > types_
void set_event_types(const std::vector< std::string > &event_types)=delete
const char * get_last_event_type() const
Return the last triggered event type (pointer to string in types_), or nullptr if no event triggered ...
CallbackManager< void(const std::string &event_type)> event_callback_
Providing packet encoding functions for exchanging data with a remote host.