1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 15:12:06 +00:00
This commit is contained in:
J. Nick Koston
2025-10-30 13:19:45 -05:00
parent 6dff2d6240
commit 2e6dab89ff

View File

@@ -63,18 +63,16 @@ optional<size_t> Select::index_of(const char *option) const {
optional<size_t> Select::active_index() const {
if (this->has_state()) {
return this->active_index_;
} else {
return {};
}
return {};
}
optional<std::string> Select::at(size_t index) const {
if (this->has_index(index)) {
const auto &options = traits.get_options();
return std::string(options.at(index));
} else {
return {};
}
return {};
}
const char *Select::option_at(size_t index) const { return traits.get_options().at(index); }