[benchmark] Add both USE_API_PLAINTEXT and USE_API_NOISE defines

This commit is contained in:
J. Nick Koston
2026-03-20 16:07:30 -10:00
parent bc2654379b
commit cf7b63da60
+8 -3
View File
@@ -1,12 +1,17 @@
import esphome.codegen as cg
from tests.testing_helpers import ComponentManifestOverride
# Keep in sync with esphome/components/api/__init__.py
NOISE_C_LIB = ("esphome/noise-c", "0.1.11")
def override_manifest(manifest: ComponentManifestOverride) -> None:
# Add USE_API_PLAINTEXT so frame helper headers compile.
# We cannot use enable_codegen() because the full api to_code
# brings in socket/network setup that fails in benchmark builds.
# Add defines for frame helper headers without running the full api
# to_code (which brings in socket/network setup that fails in
# benchmark builds).
async def to_code(config):
cg.add_define("USE_API_PLAINTEXT")
cg.add_define("USE_API_NOISE")
cg.add_library(*NOISE_C_LIB)
manifest.to_code = to_code