ESPHome
2024.10.2
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
#include <vector>
7
8
namespace
esphome
{
9
namespace
custom {
10
11
class
CustomTextSensorConstructor
:
public
Component
{
12
public
:
13
CustomTextSensorConstructor
(
const
std::function<std::vector<text_sensor::TextSensor *>()> &
init
) {
14
this->
text_sensors_
=
init
();
15
}
16
17
text_sensor::TextSensor
*
get_text_sensor
(
int
i) {
return
this->
text_sensors_
[i]; }
18
19
void
dump_config
()
override
;
20
21
protected
:
22
std::vector<text_sensor::TextSensor *>
text_sensors_
;
23
};
24
25
}
// namespace custom
26
}
// namespace esphome
esphome::Component
Definition:
component.h:68
esphome::custom::CustomTextSensorConstructor
Definition:
custom_text_sensor.h:11
esphome::custom::CustomTextSensorConstructor::get_text_sensor
text_sensor::TextSensor * get_text_sensor(int i)
Definition:
custom_text_sensor.h:17
esphome::custom::CustomTextSensorConstructor::dump_config
void dump_config() override
Definition:
custom_text_sensor.cpp:9
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:34
esphome::custom::CustomTextSensorConstructor::text_sensors_
std::vector< text_sensor::TextSensor * > text_sensors_
Definition:
custom_text_sensor.h:22
esphome::custom::CustomTextSensorConstructor::CustomTextSensorConstructor
CustomTextSensorConstructor(const std::function< std::vector< text_sensor::TextSensor *>()> &init)
Definition:
custom_text_sensor.h:13
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
esphome::init
void init()
Definition:
core.cpp:80
text_sensor.h
Generated by
1.8.13