ESPHome 2025.12.0-dev
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:184
size_t size() const
Definition helpers.h:338
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
Definition helpers.h:298
void init(size_t n)
Definition helpers.h:271
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