1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 15:26:01 +00:00

[select] Convert remaining components to use index-based control() (#11693)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-11-05 20:55:26 -06:00
committed by GitHub
parent 822eacfd77
commit 74187845b7
24 changed files with 61 additions and 90 deletions

View File

@@ -3,9 +3,9 @@
namespace esphome {
namespace es8388 {
void ADCInputMicSelect::control(const std::string &value) {
this->publish_state(value);
this->parent_->set_adc_input_mic(static_cast<AdcInputMicLine>(this->index_of(value).value()));
void ADCInputMicSelect::control(size_t index) {
this->publish_state(index);
this->parent_->set_adc_input_mic(static_cast<AdcInputMicLine>(index));
}
} // namespace es8388