mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-30 09:48:27 +02:00
Run post scripts for factory binaries for flashing (#3003)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
@@ -410,6 +410,17 @@ class DownloadBinaryRequestHandler(BaseHandler):
|
||||
filename = f"{storage_json.name}.bin"
|
||||
path = storage_json.firmware_bin_path
|
||||
|
||||
elif type == "firmware-factory.bin":
|
||||
storage_path = ext_storage_path(settings.config_dir, configuration)
|
||||
storage_json = StorageJSON.load(storage_path)
|
||||
if storage_json is None:
|
||||
self.send_error(404)
|
||||
return
|
||||
filename = f"{storage_json.name}.bin"
|
||||
path = storage_json.firmware_bin_path.replace(
|
||||
"firmware.bin", "firmware-factory.bin"
|
||||
)
|
||||
|
||||
else:
|
||||
args = ["esphome", "idedata", settings.rel_path(configuration)]
|
||||
rc, stdout, _ = run_system_command(*args)
|
||||
|
||||
Reference in New Issue
Block a user