diff --git a/esphome/components/select/select_call.cpp b/esphome/components/select/select_call.cpp index ae1e6b2f39..37462b67ec 100644 --- a/esphome/components/select/select_call.cpp +++ b/esphome/components/select/select_call.cpp @@ -13,7 +13,7 @@ SelectCall &SelectCall::set_option(const std::string &option) { SelectCall &SelectCall::set_option(const char *option) { return with_operation(SELECT_OP_SET).with_option(option); } -SelectCall &SelectCall::set_index(size_t index) { return with_operation(SELECT_OP_SET_INDEX).with_index(index); } +SelectCall &SelectCall::set_index(size_t index) { return with_operation(SELECT_OP_SET).with_index(index); } SelectCall &SelectCall::select_next(bool cycle) { return with_operation(SELECT_OP_NEXT).with_cycle(cycle); } @@ -61,7 +61,8 @@ optional SelectCall::calculate_target_index_(const char *name) { return options.size() - 1; } - if (this->operation_ == SELECT_OP_SET || this->operation_ == SELECT_OP_SET_INDEX) { + if (this->operation_ == SELECT_OP_SET) { + ESP_LOGD(TAG, "'%s' - Setting", name); if (!this->index_.has_value()) { ESP_LOGW(TAG, "'%s' - No option set", name); return {}; @@ -71,9 +72,6 @@ optional SelectCall::calculate_target_index_(const char *name) { ESP_LOGW(TAG, "'%s' - Index value %zu out of bounds", name, idx); return {}; } - if (this->operation_ == SELECT_OP_SET) { - ESP_LOGD(TAG, "'%s' - Setting", name); - } return idx; } diff --git a/esphome/components/select/select_call.h b/esphome/components/select/select_call.h index 0b83cb143a..eae7d3de1d 100644 --- a/esphome/components/select/select_call.h +++ b/esphome/components/select/select_call.h @@ -10,7 +10,6 @@ class Select; enum SelectOperation { SELECT_OP_NONE, SELECT_OP_SET, - SELECT_OP_SET_INDEX, SELECT_OP_NEXT, SELECT_OP_PREVIOUS, SELECT_OP_FIRST,