Expose enable_deflate() so the inflater can be opted out of later

This commit is contained in:
J. Nick Koston
2026-09-08 14:14:42 +02:00
parent 6146e625dd
commit 157294a99c
+6 -1
View File
@@ -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