From f15c83462c8d8c2dafbeb0b865431013ba3df635 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 18 Sep 2025 15:06:51 -0500 Subject: [PATCH] preen --- esphome/components/esphome/ota/__init__.py | 5 ++--- esphome/components/sha256/sha256.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/esphome/components/esphome/ota/__init__.py b/esphome/components/esphome/ota/__init__.py index 5579b9ec37..3134fadf26 100644 --- a/esphome/components/esphome/ota/__init__.py +++ b/esphome/components/esphome/ota/__init__.py @@ -30,7 +30,7 @@ DEPENDENCIES = ["network"] def AUTO_LOAD(): """Conditionally auto-load sha256 only on platforms that support it.""" base_components = ["md5", "socket"] - if CORE.is_esp32 or CORE.is_esp8266 or CORE.is_rp2040: + if CORE.is_esp32 or CORE.is_esp8266 or CORE.is_rp2040 or CORE.is_libretiny: return base_components + ["sha256"] return base_components @@ -136,8 +136,7 @@ async def to_code(config): cg.add(var.set_port(config[CONF_PORT])) # Only include SHA256 support on platforms that have it - # This prevents including unnecessary SHA256 code on platforms like LibreTiny - if CORE.is_esp32 or CORE.is_esp8266 or CORE.is_rp2040: + if CORE.is_esp32 or CORE.is_esp8266 or CORE.is_rp2040 or CORE.is_libretiny: cg.add_define("USE_OTA_SHA256") if CONF_PASSWORD in config: diff --git a/esphome/components/sha256/sha256.cpp b/esphome/components/sha256/sha256.cpp index 1723fc6851..3788c28741 100644 --- a/esphome/components/sha256/sha256.cpp +++ b/esphome/components/sha256/sha256.cpp @@ -4,7 +4,7 @@ #ifdef USE_ESP32 #include "mbedtls/sha256.h" -#elif defined(USE_ESP8266) || defined(USE_RP2040) +#elif defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY) #include #endif @@ -45,7 +45,7 @@ void SHA256::calculate() { mbedtls_sha256_finish(&this->ctx_->ctx, this->ctx_->hash); } -#elif defined(USE_ESP8266) || defined(USE_RP2040) +#elif defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY) struct SHA256::SHA256Context { ::SHA256 sha;