ESPHome
2024.12.2
esphome
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::template_::TemplateTextSensor::f_
optional< std::function< optional< std::string >)> > f_
Definition:
template_text_sensor.h:21
esphome::template_::TemplateTextSensor::update
void update() override
Definition:
template_text_sensor.cpp:9
automation.h
esphome::template_::TemplateTextSensor
Definition:
template_text_sensor.h:10
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition:
component.h:283
esphome::template_::TemplateTextSensor::dump_config
void dump_config() override
Definition:
template_text_sensor.cpp:20
esphome::template_::TemplateTextSensor::get_setup_priority
float get_setup_priority() const override
Definition:
template_text_sensor.cpp:18
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:34
esphome::template_::TemplateTextSensor::set_template
void set_template(std::function< optional< std::string >()> &&f)
Definition:
template_text_sensor.cpp:19
esphome::optional< std::string >
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
text_sensor.h
Generated by
1.8.13