ESPHome
2026.5.0-dev
Loading...
Searching...
No Matches
esphome
components
lvgl
text
lvgl_text.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/text/text.h
"
4
#include "
esphome/core/automation.h
"
5
#include "
esphome/core/component.h
"
6
7
namespace
esphome
{
8
namespace
lvgl {
9
10
class
LVGLText
:
public
text::Text
{
11
public
:
12
void
set_control_lambda
(
const
std::function<
void
(std::string)> &control_lambda) {
13
this->
control_lambda_
= control_lambda;
14
if
(this->
initial_state_
.has_value()) {
15
this->
control_lambda_
(this->
initial_state_
.value());
16
this->
initial_state_
.reset();
17
}
18
}
19
20
protected
:
21
void
control
(
const
std::string &value)
override
{
22
if
(this->
control_lambda_
!=
nullptr
) {
23
this->
control_lambda_
(value);
24
}
else
{
25
this->
initial_state_
= value;
26
}
27
}
28
std::function<void(std::string)>
control_lambda_
{};
29
optional<std::string>
initial_state_
{};
30
};
31
32
}
// namespace lvgl
33
}
// namespace esphome
esphome::lvgl::LVGLText
Definition
lvgl_text.h:10
esphome::lvgl::LVGLText::control
void control(const std::string &value) override
Definition
lvgl_text.h:21
esphome::lvgl::LVGLText::control_lambda_
std::function< void(std::string)> control_lambda_
Definition
lvgl_text.h:28
esphome::lvgl::LVGLText::initial_state_
optional< std::string > initial_state_
Definition
lvgl_text.h:29
esphome::lvgl::LVGLText::set_control_lambda
void set_control_lambda(const std::function< void(std::string)> &control_lambda)
Definition
lvgl_text.h:12
esphome::text::Text
Base-class for all text inputs.
Definition
text.h:21
component.h
automation.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
text.h
Generated by
1.12.0