The walrus ran away

This commit is contained in:
Jesse Hills 2024-04-29 11:50:23 +12:00
parent e234557cf3
commit 164936c5fb
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
2 changed files with 8 additions and 10 deletions

View File

@ -332,11 +332,10 @@ def upload_program(config, args, host):
return 1 # Unknown target platform
ota_conf = {}
if ota := config.get(CONF_OTA):
for ota_item in ota:
if ota_item[CONF_PLATFORM] == CONF_ESPHOME:
ota_conf = ota_item
break
for ota_item in config.get(CONF_OTA, []):
if ota_item[CONF_PLATFORM] == CONF_ESPHOME:
ota_conf = ota_item
break
if not ota_conf:
raise EsphomeError(

View File

@ -142,11 +142,10 @@ async def build_registry_list(registry, config):
async def past_safe_mode():
ota_conf = {}
if CONF_OTA in CORE.config:
for ota_item in CORE.config.get(CONF_OTA):
if ota_item[CONF_PLATFORM] == CONF_ESPHOME:
ota_conf = ota_item
break
for ota_item in CORE.config.get(CONF_OTA, []):
if ota_item[CONF_PLATFORM] == CONF_ESPHOME:
ota_conf = ota_item
break
if not ota_conf:
return