From b089a4ea804c8d1e103cb220d5454c7377c3d331 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 25 Nov 2022 13:47:02 +1300 Subject: [PATCH] Allow manually specifying binary file to OTA (#4054) --- esphome/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/__main__.py b/esphome/__main__.py index cf2d161d04..a4f010c6ad 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -298,6 +298,8 @@ def upload_program(config, args, host): ota_conf = config[CONF_OTA] remote_port = ota_conf[CONF_PORT] password = ota_conf.get(CONF_PASSWORD, "") + if args.file is not None: + return espota2.run_ota(host, remote_port, password, args.file) return espota2.run_ota(host, remote_port, password, CORE.firmware_bin) @@ -687,6 +689,10 @@ def parse_args(argv): "--device", help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.", ) + parser_upload.add_argument( + "--file", + help="Manually specify the binary file to upload.", + ) parser_logs = subparsers.add_parser( "logs",