[api] Remove USE_API guards from api_pb2_service (aligned with parent PR)

This commit is contained in:
J. Nick Koston
2026-03-22 21:18:04 -10:00
parent 2cdb301fc4
commit f059a1c2ea
2 changed files with 1 additions and 9 deletions
@@ -1,9 +1,7 @@
// This file was automatically generated with a tool. // This file was automatically generated with a tool.
// See script/api_protobuf/api_protobuf.py // See script/api_protobuf/api_protobuf.py
#include "api_pb2_service.h" #include "api_pb2_service.h"
#ifdef USE_API
#include "api_connection.h" #include "api_connection.h"
#endif
#include "esphome/core/log.h" #include "esphome/core/log.h"
namespace esphome::api { namespace esphome::api {
@@ -23,7 +21,6 @@ void APIServerConnectionBase::log_receive_message_(const LogString *name) {
} }
#endif #endif
#ifdef USE_API
void APIConnection::read_message_(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) { void APIConnection::read_message_(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) {
// Check authentication/connection requirements // Check authentication/connection requirements
switch (msg_type) { switch (msg_type) {
@@ -709,6 +706,5 @@ void APIConnection::read_message_(uint32_t msg_size, uint32_t msg_type, const ui
break; break;
} }
} }
#endif // USE_API
} // namespace esphome::api } // namespace esphome::api
+1 -5
View File
@@ -2947,9 +2947,7 @@ namespace esphome::api {
cpp = FILE_HEADER cpp = FILE_HEADER
cpp += """\ cpp += """\
#include "api_pb2_service.h" #include "api_pb2_service.h"
#ifdef USE_API
#include "api_connection.h" #include "api_connection.h"
#endif
#include "esphome/core/log.h" #include "esphome/core/log.h"
namespace esphome::api { namespace esphome::api {
@@ -3057,8 +3055,7 @@ static const char *const TAG = "api.service";
# can devirtualize and inline the on_* handler calls within the same class. # can devirtualize and inline the on_* handler calls within the same class.
# APIConnection declares this method in api_connection.h. # APIConnection declares this method in api_connection.h.
out = "#ifdef USE_API\n" out = "void APIConnection::read_message_(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) {\n"
out += "void APIConnection::read_message_(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) {\n"
# Auth check block before dispatch switch # Auth check block before dispatch switch
out += " // Check authentication/connection requirements\n" out += " // Check authentication/connection requirements\n"
@@ -3103,7 +3100,6 @@ static const char *const TAG = "api.service";
out += " break;\n" out += " break;\n"
out += " }\n" out += " }\n"
out += "}\n" out += "}\n"
out += "#endif // USE_API\n"
cpp += out cpp += out
hpp += "};\n" hpp += "};\n"