ESPHome
2026.10.0-dev
Loading...
Searching...
No Matches
esphome
components
select
select_traits.cpp
Go to the documentation of this file.
1
#include "
select_traits.h
"
2
3
namespace
esphome::select
{
4
5
void
SelectTraits::set_options
(
const
std::initializer_list<const char *> &
options
) { this->
options_
=
options
; }
6
7
void
SelectTraits::set_options
(
const
FixedVector<const char *>
&
options
) {
8
this->
options_
.
init
(options.
size
());
9
for
(
const
auto
&opt :
options
) {
10
this->
options_
.
push_back
(opt);
11
}
12
}
13
14
}
// namespace esphome::select
esphome::FixedVector
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
Definition
helpers.h:545
esphome::FixedVector::size
size_t size() const
Definition
helpers.h:711
esphome::FixedVector::push_back
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
Definition
helpers.h:662
esphome::FixedVector::init
void init(size_t n)
Definition
helpers.h:635
esphome::select::SelectTraits::options_
FixedVector< const char * > options_
Definition
select_traits.h:15
esphome::select::SelectTraits::set_options
void set_options(const std::initializer_list< const char * > &options)
Definition
select_traits.cpp:5
options
uint8_t options
Definition
e131_packet.cpp:15
esphome::select
Definition
automation.h:7
select_traits.h
Generated by
1.12.0