ESPHome
2024.12.2
esphome
esphome
components
mqtt_subscribe
text_sensor
mqtt_subscribe_text_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/defines.h
"
4
5
#ifdef USE_MQTT
6
7
#include "
esphome/core/component.h
"
8
#include "
esphome/components/text_sensor/text_sensor.h
"
9
#include "
esphome/components/mqtt/mqtt_client.h
"
10
11
namespace
esphome
{
12
namespace
mqtt_subscribe {
13
14
class
MQTTSubscribeTextSensor
:
public
text_sensor::TextSensor
,
public
Component
{
15
public
:
16
void
set_parent
(
mqtt::MQTTClientComponent
*parent) {
parent_
= parent; }
17
void
set_topic
(
const
std::string &topic) {
topic_
= topic; }
18
void
setup
()
override
;
19
void
dump_config
()
override
;
20
float
get_setup_priority
()
const override
;
21
void
set_qos
(uint8_t qos);
22
23
protected
:
24
mqtt::MQTTClientComponent
*
parent_
;
25
std::string
topic_
;
26
uint8_t
qos_
{};
27
};
28
29
}
// namespace mqtt_subscribe
30
}
// namespace esphome
31
32
#endif // USE_MQTT
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::dump_config
void dump_config() override
Definition:
mqtt_subscribe_text_sensor.cpp:20
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::set_parent
void set_parent(mqtt::MQTTClientComponent *parent)
Definition:
mqtt_subscribe_text_sensor.h:16
mqtt_client.h
esphome::mqtt::MQTTClientComponent
Definition:
mqtt_client.h:99
esphome::Component
Definition:
component.h:68
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::qos_
uint8_t qos_
Definition:
mqtt_subscribe_text_sensor.h:26
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::set_qos
void set_qos(uint8_t qos)
Definition:
mqtt_subscribe_text_sensor.cpp:19
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::setup
void setup() override
Definition:
mqtt_subscribe_text_sensor.cpp:13
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:34
defines.h
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::set_topic
void set_topic(const std::string &topic)
Definition:
mqtt_subscribe_text_sensor.h:17
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::topic_
std::string topic_
Definition:
mqtt_subscribe_text_sensor.h:25
esphome::mqtt_subscribe::MQTTSubscribeTextSensor
Definition:
mqtt_subscribe_text_sensor.h:14
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::get_setup_priority
float get_setup_priority() const override
Definition:
mqtt_subscribe_text_sensor.cpp:18
text_sensor.h
esphome::mqtt_subscribe::MQTTSubscribeTextSensor::parent_
mqtt::MQTTClientComponent * parent_
Definition:
mqtt_subscribe_text_sensor.h:24
Generated by
1.8.13