ESPHome
2022.5.1
esphome
esphome
components
custom
text_sensor
custom_text_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/text_sensor/text_sensor.h
"
5
6
namespace
esphome
{
7
namespace
custom {
8
9
class
CustomTextSensorConstructor
:
public
Component
{
10
public
:
11
CustomTextSensorConstructor
(
const
std::function<std::vector<text_sensor::TextSensor *>()> &
init
) {
12
this->
text_sensors_
=
init
();
13
}
14
15
text_sensor::TextSensor
*
get_text_sensor
(
int
i) {
return
this->
text_sensors_
[i]; }
16
17
void
dump_config
()
override
;
18
19
protected
:
20
std::vector<text_sensor::TextSensor *>
text_sensors_
;
21
};
22
23
}
// namespace custom
24
}
// namespace esphome
esphome::Component
Definition:
component.h:66
esphome::custom::CustomTextSensorConstructor
Definition:
custom_text_sensor.h:9
esphome::custom::CustomTextSensorConstructor::get_text_sensor
text_sensor::TextSensor * get_text_sensor(int i)
Definition:
custom_text_sensor.h:15
text_sensor.h
esphome::custom::CustomTextSensorConstructor::dump_config
void dump_config() override
Definition:
custom_text_sensor.cpp:9
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:22
esphome::custom::CustomTextSensorConstructor::text_sensors_
std::vector< text_sensor::TextSensor * > text_sensors_
Definition:
custom_text_sensor.h:20
esphome::custom::CustomTextSensorConstructor::CustomTextSensorConstructor
CustomTextSensorConstructor(const std::function< std::vector< text_sensor::TextSensor *>()> &init)
Definition:
custom_text_sensor.h:11
esphome
Definition:
a4988.cpp:4
component.h
esphome::init
void init()
Definition:
core.cpp:85
Generated by
1.8.13