ESPHome
2025.2.2
Main Page
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
d
e
f
i
j
l
m
n
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
d
o
p
s
t
v
w
+
Enumerations
b
c
e
f
i
m
n
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Functions
_
a
l
m
o
s
t
u
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
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