ESPHome
2024.12.4
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
text
text.cpp
Go to the documentation of this file.
1
#include "
text.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome
{
5
namespace
text {
6
7
static
const
char
*
const
TAG
=
"text"
;
8
9
void
Text::publish_state
(
const
std::string &
state
) {
10
this->
has_state_
=
true
;
11
this->state =
state
;
12
if
(this->
traits
.
get_mode
() ==
TEXT_MODE_PASSWORD
) {
13
ESP_LOGD(TAG,
"'%s': Sending state "
LOG_SECRET(
"'%s'"
), this->
get_name
().c_str(), state.
c_str
());
14
15
}
else
{
16
ESP_LOGD(TAG,
"'%s': Sending state %s"
, this->
get_name
().c_str(), state.
c_str
());
17
}
18
this->
state_callback_
.call(state);
19
}
20
21
void
Text::add_on_state_callback
(std::function<
void
(std::string)> &&callback) {
22
this->
state_callback_
.add(std::move(callback));
23
}
24
25
}
// namespace text
26
}
// namespace esphome
esphome::text::Text::has_state_
bool has_state_
Definition:
text.h:51
esphome::text::TextTraits::get_mode
TextMode get_mode() const
Definition:
text_traits.h:29
esphome::text::Text::state
std::string state
Definition:
text.h:26
esphome::text::Text::traits
TextTraits traits
Definition:
text.h:27
text.h
esphome::text::Text::state_callback_
CallbackManager< void(std::string)> state_callback_
Definition:
text.h:50
esphome::spi::TAG
const char *const TAG
Definition:
spi.cpp:8
esphome::text::Text::add_on_state_callback
void add_on_state_callback(std::function< void(std::string)> &&callback)
Definition:
text.cpp:21
esphome::text::TEXT_MODE_PASSWORD
Definition:
text_traits.h:12
esphome::text::Text::publish_state
void publish_state(const std::string &state)
Definition:
text.cpp:9
esphome::StringRef::c_str
constexpr const char * c_str() const
Definition:
string_ref.h:68
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
log.h
esphome::EntityBase::get_name
const StringRef & get_name() const
Definition:
entity_base.cpp:10
state
bool state
Definition:
fan.h:34
Generated by
1.8.13