From 09f97d86e68761ed8c79decd65f960b6b0ab055d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Oct 2025 04:31:16 -0700 Subject: [PATCH] [select] Store options in flash to reduce RAM usage --- esphome/components/select/select_traits.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esphome/components/select/select_traits.cpp b/esphome/components/select/select_traits.cpp index 90a70393d1..dc849b8b7e 100644 --- a/esphome/components/select/select_traits.cpp +++ b/esphome/components/select/select_traits.cpp @@ -5,7 +5,12 @@ namespace select { void SelectTraits::set_options(std::initializer_list options) { this->options_ = options; } -void SelectTraits::set_options(const FixedVector &options) { this->options_ = options; } +void SelectTraits::set_options(const FixedVector &options) { + this->options_.init(options.size()); + for (size_t i = 0; i < options.size(); i++) { + this->options_[i] = options[i]; + } +} const FixedVector &SelectTraits::get_options() const { return this->options_; }