ESPHome  2024.12.0
install_height_select.cpp
Go to the documentation of this file.
2 
3 namespace esphome {
4 namespace seeed_mr60fda2 {
5 
6 void InstallHeightSelect::control(const std::string &value) {
7  this->publish_state(value);
8  auto index = this->index_of(value);
9  if (index.has_value()) {
10  this->parent_->set_install_height(index.value());
11  }
12 }
13 
14 } // namespace seeed_mr60fda2
15 } // namespace esphome
void control(const std::string &value) override
void publish_state(const std::string &state)
Definition: select.cpp:9
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
optional< size_t > index_of(const std::string &option) const
Find the (optional) index offset of the provided option value.
Definition: select.cpp:35