diff --git a/esphome/components/select/select.cpp b/esphome/components/select/select.cpp index e495ab4a44..fae485709e 100644 --- a/esphome/components/select/select.cpp +++ b/esphome/components/select/select.cpp @@ -26,7 +26,10 @@ void Select::publish_state(size_t index) { const char *option = this->option_at(index); this->set_has_state(true); this->active_index_ = index; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" this->state = option; // Update deprecated member for backward compatibility +#pragma GCC diagnostic pop ESP_LOGD(TAG, "'%s': Sending state %s (index %zu)", this->get_name().c_str(), option, index); // Callback signature requires std::string, create temporary for compatibility this->state_callback_.call(std::string(option), index);