12 static const char *
const TAG =
"mqtt.event";
21 event_types.add(event_type);
35 ESP_LOGCONFIG(TAG,
"Event Types: ");
37 ESP_LOGCONFIG(TAG,
"- %s", event_type.c_str());
39 LOG_MQTT_COMPONENT(
true,
true);
std::string get_device_class()
Get the device class, using the manual override if set.
constexpr const char *const MQTT_EVENT_TYPES
std::string component_type() const override
std::set< std::string > get_event_types() const
MQTTEventComponent(event::Event *event)
void add_on_event_callback(std::function< void(const std::string &event_type)> &&callback)
bool publish_json(const std::string &topic, const json::json_build_t &f)
Construct and send a JSON MQTT message.
bool command_topic
If the command topic should be included. Default to true.
const EntityBase * get_entity() const override
void dump_config() override
Simple Helper struct used for Home Assistant MQTT send_discovery().
constexpr const char * c_str() const
constexpr const char *const MQTT_EVENT_TYPE
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
Implementation of SPI Controller mode.
bool publish_event_(const std::string &event_type)
constexpr const char *const MQTT_DEVICE_CLASS
std::string get_state_topic_() const
Get the MQTT topic that new states will be shared to.
const StringRef & get_name() const