From e9a0d0688057a5bcc9915486969cafb752b6894b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 9 Feb 2026 09:31:19 -0600 Subject: [PATCH] Add comment explaining early guard --- esphome/components/tuya/tuya.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/tuya/tuya.cpp b/esphome/components/tuya/tuya.cpp index d0e00d425de..8d15b6d6383 100644 --- a/esphome/components/tuya/tuya.cpp +++ b/esphome/components/tuya/tuya.cpp @@ -31,6 +31,8 @@ void Tuya::setup() { } void Tuya::loop() { + // Early return avoids stack adjustment for the batch buffer below. + // loop() runs ~7000/min so most calls have nothing to read. int avail = this->available(); if (avail > 0) { // Read all available bytes in batches to reduce UART call overhead.