ESPHome  2024.11.1
unman_time_select.cpp
Go to the documentation of this file.
1 #include "unman_time_select.h"
2 
3 namespace esphome {
4 namespace seeed_mr24hpc1 {
5 
6 void UnmanTimeSelect::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_unman_time(index.value());
11  }
12 }
13 
14 } // namespace seeed_mr24hpc1
15 } // namespace esphome
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
void control(const std::string &value) override