[nextion] Fix RP2040 clang-tidy failure from TFT upload guard mismatch (#17638)

This commit is contained in:
Keith Burzinski
2026-07-17 08:07:38 -04:00
committed by GitHub
parent 735f8d607d
commit 2132cae1c9
4 changed files with 29 additions and 7 deletions
-1
View File
@@ -19,7 +19,6 @@ FILTER_SOURCE_FILES = filter_source_files_from_platform(
},
"nextion_upload_arduino.cpp": {
PlatformFramework.ESP8266_ARDUINO,
PlatformFramework.RP2_ARDUINO,
PlatformFramework.BK72XX_ARDUINO,
PlatformFramework.RTL87XX_ARDUINO,
PlatformFramework.LN882X_ARDUINO,
+25 -2
View File
@@ -4,7 +4,17 @@ from esphome import automation
import esphome.codegen as cg
from esphome.components import display, esp32, uart
import esphome.config_validation as cv
from esphome.const import CONF_BRIGHTNESS, CONF_ID, CONF_LAMBDA, CONF_ON_TOUCH
from esphome.const import (
CONF_BRIGHTNESS,
CONF_ID,
CONF_LAMBDA,
CONF_ON_TOUCH,
PLATFORM_BK72XX,
PLATFORM_ESP32,
PLATFORM_ESP8266,
PLATFORM_LN882X,
PLATFORM_RTL87XX,
)
from esphome.core import CORE, TimePeriod
from . import ( # noqa: F401 pylint: disable=unused-import
@@ -135,7 +145,20 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(
CONF_TFT_UPLOAD_WATCHDOG_TIMEOUT
): cv.positive_time_period_milliseconds,
cv.Optional(CONF_TFT_URL): cv.url,
# TFT upload needs an HTTP client and runtime UART reconfiguration,
# neither of which is implemented for the RP2 or host platforms.
cv.Optional(CONF_TFT_URL): cv.All(
cv.url,
cv.only_on(
[
PLATFORM_ESP32,
PLATFORM_ESP8266,
PLATFORM_BK72XX,
PLATFORM_RTL87XX,
PLATFORM_LN882X,
]
),
),
cv.Optional(CONF_TOUCH_SLEEP_TIMEOUT): cv.Any(
0, cv.int_range(min=3, max=65535)
),
+2 -2
View File
@@ -1566,7 +1566,7 @@ class Nextion final : public NextionBase, public PollingComponent, public uart::
* @return position of last byte transferred, -1 for failure.
*/
int upload_by_chunks_(esp_http_client_handle_t http_client, uint32_t &range_start);
#elif defined(USE_ARDUINO)
#elif defined(USE_ESP8266) || defined(USE_LIBRETINY)
/**
* will request chunk_size chunks from the web server
* and send each to the nextion
@@ -1575,7 +1575,7 @@ class Nextion final : public NextionBase, public PollingComponent, public uart::
* @return position of last byte transferred, -1 for failure.
*/
int upload_by_chunks_(HTTPClient &http_client, uint32_t &range_start);
#endif // USE_ESP32 vs USE_ARDUINO
#endif // USE_ESP32 vs USE_ESP8266/USE_LIBRETINY
/**
* Ends the upload process, restart Nextion and, if successful,
@@ -1,7 +1,7 @@
#include "nextion.h"
#ifdef USE_NEXTION_TFT_UPLOAD
#ifndef USE_ESP32
#if defined(USE_ESP8266) || defined(USE_LIBRETINY)
#include <cinttypes>
#include "esphome/components/network/util.h"
@@ -378,5 +378,5 @@ WiFiClient *Nextion::get_wifi_client_() {
} // namespace esphome::nextion
#endif // NOT USE_ESP32
#endif // USE_ESP8266 || USE_LIBRETINY
#endif // USE_NEXTION_TFT_UPLOAD