MQTT Subscribe Sensor

See Application::make_mqtt_subscribe_sensor().

API Reference

class MQTTSubscribeSensor : public sensor::Sensor, public Component

Public Functions

MQTTSubscribeSensor(const std::string &name, std::string topic)
void setup()

Where the component’s initialization should happen.

Analogous to Arduino’s setup(). This method is guaranteed to only be called once. Defaults to doing nothing.

void dump_config()
float get_setup_priority() const

priority of setup().

higher -> executed earlier

Defaults to 0.

The setup priority of this component

void set_qos(uint8_t qos)

Protected Attributes

std::string topic_
uint8_t qos_ = {0}