12 static const char *
const TAG =
"mqtt.button";
20 if (payload ==
"PRESS") {
23 ESP_LOGW(TAG,
"'%s': Received unknown status payload: %s", this->
friendly_name().c_str(), payload.c_str());
30 LOG_MQTT_COMPONENT(
true,
true);
std::string get_device_class()
Get the device class, using the manual override if set.
void status_momentary_warning(const std::string &name, uint32_t length=5000)
bool state_topic
If the state topic should be included. Defaults to true.
void subscribe(const std::string &topic, mqtt_callback_t callback, uint8_t qos=0)
Subscribe to a MQTT topic.
Simple Helper struct used for Home Assistant MQTT send_discovery().
constexpr const char * c_str() const
virtual std::string friendly_name() const
Get the friendly name of this MQTT component.
Implementation of SPI Controller mode.
constexpr const char *const MQTT_DEVICE_CLASS
std::string get_command_topic_() const
Get the MQTT topic for listening to commands.
const StringRef & get_name() const