From 157294a99c2d514f27bc5a9510b813cebb9c22f8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 8 Sep 2026 14:14:42 +0200 Subject: [PATCH] Expose enable_deflate() so the inflater can be opted out of later --- esphome/components/esphome/ota/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esphome/components/esphome/ota/__init__.py b/esphome/components/esphome/ota/__init__.py index 1aced2847b..942704dfef 100644 --- a/esphome/components/esphome/ota/__init__.py +++ b/esphome/components/esphome/ota/__init__.py @@ -290,6 +290,11 @@ FILTER_SOURCE_FILES = filter_source_files_from_defines( ) +def enable_deflate() -> None: + """Compile the on-the-fly inflater for compressed uploads.""" + cg.add_define("USE_OTA_DEFLATE") + + @coroutine_with_priority(CoroPriority.OTA_UPDATES) async def to_code(config: ConfigType) -> None: var = cg.new_Pvariable(config[CONF_ID]) @@ -310,7 +315,7 @@ async def to_code(config: ConfigType) -> None: # ESP8266 and RP2040 inflate gzip at reboot; the rest inflate on the fly if not (CORE.is_esp8266 or CORE.is_rp2): - cg.add_define("USE_OTA_DEFLATE") + enable_deflate() # One key per device: an api encryption block supplies it (static or # runtime) and offers; the ota block only adds the requirement