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