19 JsonArray event_types = root[MQTT_EVENT_TYPES].to<JsonArray>();
21 event_types.add(event_type);
31 LOG_MQTT_COMPONENT(
true,
true);
32 ESP_LOGCONFIG(TAG,
" Event Types:");
34 ESP_LOGCONFIG(TAG,
" - %s", event_type);
39 char topic_buf[MQTT_DEFAULT_TOPIC_MAX_LEN];
42 root[MQTT_EVENT_TYPE] = event_type;
const EventTypes & get_event_types() const
Return the event types supported by this event.
void add_on_event_callback(F &&callback)
bool publish_json(const std::string &topic, const json::json_build_t &f)
Construct and send a JSON MQTT message.
StringRef get_state_topic_to_(std::span< char, MQTT_DEFAULT_TOPIC_MAX_LEN > buf) const
Get the MQTT state topic into a buffer (no heap allocation for non-lambda custom topics).
bool publish_event_(const std::string &event_type)
void dump_config() override
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
MQTTEventComponent(event::Event *event)
ESPHOME_LOG_TAG(TAG, "alarm_control_panel")
MQTT_COMPONENT_TYPE(MQTTAlarmControlPanelComponent, "alarm_control_panel") const EntityBase *MQTTAlarmControlPanelComponent
Simple Helper struct used for Home Assistant MQTT send_discovery().
bool command_topic
If the command topic should be included. Default to true.