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
copy
text_sensor
copy_text_sensor.cpp
Go to the documentation of this file.
1
#include "
copy_text_sensor.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome
{
5
namespace
copy {
6
7
static
const
char
*
const
TAG =
"copy.text_sensor"
;
8
9
void
CopyTextSensor::setup
() {
10
source_
->
add_on_state_callback
([
this
](
const
std::string &value) { this->
publish_state
(value); });
11
if
(
source_
->
has_state
())
12
this->
publish_state
(
source_
->
state
);
13
}
14
15
void
CopyTextSensor::dump_config
() { LOG_TEXT_SENSOR(
""
,
"Copy Sensor"
,
this
); }
16
17
}
// namespace copy
18
}
// namespace esphome
esphome::text_sensor::TextSensor::add_on_state_callback
void add_on_state_callback(std::function< void(std::string)> callback)
Definition:
text_sensor.cpp:52
esphome::copy::CopyTextSensor::source_
text_sensor::TextSensor * source_
Definition:
copy_text_sensor.h:17
esphome::text_sensor::TextSensor::publish_state
void publish_state(const std::string &state)
Definition:
text_sensor.cpp:9
copy_text_sensor.h
esphome::text_sensor::TextSensor::has_state
bool has_state()
Definition:
text_sensor.cpp:69
esphome::copy::CopyTextSensor::dump_config
void dump_config() override
Definition:
copy_text_sensor.cpp:15
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::text_sensor::TextSensor::state
std::string state
Definition:
text_sensor.h:59
log.h
esphome::copy::CopyTextSensor::setup
void setup() override
Definition:
copy_text_sensor.cpp:9
Generated by
1.8.13