diff --git a/esphome/components/select/select_traits.cpp b/esphome/components/select/select_traits.cpp index 497bffbe01..a99847c398 100644 --- a/esphome/components/select/select_traits.cpp +++ b/esphome/components/select/select_traits.cpp @@ -3,7 +3,7 @@ namespace esphome { namespace select { -void SelectTraits::set_options(std::initializer_list options) { this->options_ = options; } +void SelectTraits::set_options(const std::initializer_list &options) { this->options_ = options; } const FixedVector &SelectTraits::get_options() const { return this->options_; } diff --git a/esphome/components/select/select_traits.h b/esphome/components/select/select_traits.h index 826ef14924..eb98d05958 100644 --- a/esphome/components/select/select_traits.h +++ b/esphome/components/select/select_traits.h @@ -9,7 +9,7 @@ namespace select { class SelectTraits { public: - void set_options(std::initializer_list options); + void set_options(const std::initializer_list &options); const FixedVector &get_options() const; /// Copy options from another SelectTraits (for copy_select, lvgl) void copy_options(const FixedVector &other) { this->options_.copy_from(other); }