diff --git a/esphome/__main__.py b/esphome/__main__.py index df57cf5ab7..a83cbbfeb1 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -332,8 +332,8 @@ def upload_program(config, args, host): return 1 # Unknown target platform ota_conf = {} - if CONF_OTA in config: - for ota_item in config.get(CONF_OTA): + if ota := config.get(CONF_OTA): + for ota_item in ota: if ota_item[CONF_PLATFORM] == CONF_ESPHOME: ota_conf = ota_item break