From 0867866317ee4e66fbf5571b400ff8ba8aa9b509 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 7 Mar 2026 08:42:22 -1000 Subject: [PATCH] [api] Also fall back to make_unique on LN882x; add LN882x test config --- esphome/components/api/proto.h | 2 +- tests/components/api/test.ln882x-ard.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/components/api/test.ln882x-ard.yaml diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 28cb8d49a3..589fae9895 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -239,7 +239,7 @@ class Proto32Bit { /// Helper to use make_unique_for_overwrite where available (skips zero-fill), /// falling back to make_unique on older GCC (ESP8266, BK72xx). inline std::unique_ptr make_buffer(size_t n) { -#if defined(USE_ESP8266) || defined(USE_BK72XX) +#if defined(USE_ESP8266) || defined(USE_BK72XX) || defined(USE_LN882X) return std::make_unique(n); #else return std::make_unique_for_overwrite(n); diff --git a/tests/components/api/test.ln882x-ard.yaml b/tests/components/api/test.ln882x-ard.yaml new file mode 100644 index 0000000000..46c01d926f --- /dev/null +++ b/tests/components/api/test.ln882x-ard.yaml @@ -0,0 +1,5 @@ +<<: !include common.yaml + +wifi: + ssid: MySSID + password: password1