mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
Expose enable_deflate() so the inflater can be opted out of later
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user