diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index c3cee7d80d..3031ac58f7 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -231,9 +231,7 @@ void APIConnection::loop() { msg.set_data(this->image_reader_->peek_data_buffer(), to_send); msg.done = done; - bool success = this->send_message_(msg, CameraImageResponse::MESSAGE_TYPE); - - if (success) { + if (this->send_message_(msg, CameraImageResponse::MESSAGE_TYPE)) { this->image_reader_->consume_data(to_send); if (done) { this->image_reader_->return_image();