From 957e01f466f9e753823e36a0e1e28fcbbc19e26f Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Thu, 16 May 2024 19:06:39 +0200 Subject: [PATCH] small fix --- esphome/__main__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index f25176d08c..38f5e5a31a 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -105,14 +105,13 @@ def choose_upload_log_host( ble_logger = False ota = "ota" in CORE.config options = [] + prefix = "" if mcuboot and show_ota and ota: - for port in get_serial_ports(): - options.append( - (f"mcumgr {port.path} ({port.description})", f"mcumgr {port.path}") - ) - else: - for port in get_serial_ports(): - options.append((f"{port.path} ({port.description})", port.path)) + prefix = "mcumgr " + for port in get_serial_ports(): + options.append( + (f"{prefix}{port.path} ({port.description})", f"{prefix}{port.path}") + ) if default == "SERIAL": return choose_prompt(options, purpose=purpose) if default == "PYOCD":