ESPHome
2025.5.0
Loading...
Searching...
No Matches
esphome
components
template
text_sensor
template_text_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/core/automation.h
"
5
#include "
esphome/components/text_sensor/text_sensor.h
"
6
7
namespace
esphome
{
8
namespace
template_ {
9
10
class
TemplateTextSensor
:
public
text_sensor::TextSensor
,
public
PollingComponent
{
11
public
:
12
void
set_template
(std::function<
optional<std::string>
()> &&f);
13
14
void
update
()
override
;
15
16
float
get_setup_priority
()
const override
;
17
18
void
dump_config
()
override
;
19
20
protected
:
21
optional<std::function<optional<std::string>
()>>
f_
{};
22
};
23
24
}
// namespace template_
25
}
// namespace esphome
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:301
esphome::optional
Definition
optional.h:36
esphome::template_::TemplateTextSensor
Definition
template_text_sensor.h:10
esphome::template_::TemplateTextSensor::update
void update() override
Definition
template_text_sensor.cpp:9
esphome::template_::TemplateTextSensor::f_
optional< std::function< optional< std::string >()> > f_
Definition
template_text_sensor.h:21
esphome::template_::TemplateTextSensor::get_setup_priority
float get_setup_priority() const override
Definition
template_text_sensor.cpp:18
esphome::template_::TemplateTextSensor::dump_config
void dump_config() override
Definition
template_text_sensor.cpp:20
esphome::template_::TemplateTextSensor::set_template
void set_template(std::function< optional< std::string >()> &&f)
Definition
template_text_sensor.cpp:19
esphome::text_sensor::TextSensor
Definition
text_sensor.h:34
component.h
automation.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
text_sensor.h
Generated by
1.12.0