ESPHome 2025.11.4
Loading...
Searching...
No Matches
select_traits.cpp
Go to the documentation of this file.
1#include "select_traits.h"
2
3namespace esphome {
4namespace select {
5
6void SelectTraits::set_options(const std::initializer_list<const char *> &options) { this->options_ = options; }
7
9 this->options_.init(options.size());
10 for (const auto &opt : options) {
11 this->options_.push_back(opt);
12 }
13}
14
16
17} // namespace select
18} // namespace esphome
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
Definition helpers.h:167
size_t size() const
Definition helpers.h:324
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
Definition helpers.h:284
void init(size_t n)
Definition helpers.h:257
const FixedVector< const char * > & get_options() const
FixedVector< const char * > options_
void set_options(const std::initializer_list< const char * > &options)
uint8_t options
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7