diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index 841aa55423..4ce1335650 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -44,18 +44,22 @@ static constexpr size_t MAX_INITIAL_PER_BATCH = 34; // For clients >= AP static_assert(MAX_MESSAGES_PER_BATCH >= MAX_INITIAL_PER_BATCH, "MAX_MESSAGES_PER_BATCH must be >= MAX_INITIAL_PER_BATCH"); +#ifdef USE_BENCHMARK class APIConnection; -void bench_enable_immediate_send(APIConnection *conn); // tests/benchmarks -void bench_clear_batch(APIConnection *conn); // tests/benchmarks -void bench_process_batch(APIConnection *conn); // tests/benchmarks +void bench_enable_immediate_send(APIConnection *conn); +void bench_clear_batch(APIConnection *conn); +void bench_process_batch(APIConnection *conn); +#endif class APIConnection final : public APIServerConnectionBase { public: friend class APIServer; friend class ListEntitiesIterator; +#ifdef USE_BENCHMARK friend void bench_enable_immediate_send(APIConnection *conn); friend void bench_clear_batch(APIConnection *conn); friend void bench_process_batch(APIConnection *conn); +#endif APIConnection(std::unique_ptr socket, APIServer *parent); ~APIConnection();