1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 15:12:06 +00:00

[select] Store options in flash to reduce RAM usage

This commit is contained in:
J. Nick Koston
2025-10-24 04:31:16 -07:00
parent 83e4013a25
commit 09f97d86e6

View File

@@ -5,7 +5,12 @@ namespace select {
void SelectTraits::set_options(std::initializer_list<const char *> options) { this->options_ = options; } void SelectTraits::set_options(std::initializer_list<const char *> options) { this->options_ = options; }
void SelectTraits::set_options(const FixedVector<const char *> &options) { this->options_ = options; } void SelectTraits::set_options(const FixedVector<const char *> &options) {
this->options_.init(options.size());
for (size_t i = 0; i < options.size(); i++) {
this->options_[i] = options[i];
}
}
const FixedVector<const char *> &SelectTraits::get_options() const { return this->options_; } const FixedVector<const char *> &SelectTraits::get_options() const { return this->options_; }