1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-08 20:00:27 +01:00

remove duplicate keys

This commit is contained in:
Tomasz Duda 2024-05-08 23:49:26 +02:00
parent 834425ce0f
commit 12230ce4d7
2 changed files with 3 additions and 4 deletions

View File

@ -21,14 +21,13 @@ from .const import (
BOOTLOADER_MCUBOOT, BOOTLOADER_MCUBOOT,
KEY_EXTRA_BUILD_FILES, KEY_EXTRA_BUILD_FILES,
KEY_PATH, KEY_PATH,
KEY_BOOTLOADER,
) )
AUTO_LOAD = ["preferences"] AUTO_LOAD = ["preferences"]
KEY_BOARD = "board" KEY_BOARD = "board"
KEY_BOOTLOADER = "bootloader"
def zephyr_set_core_data(config): def zephyr_set_core_data(config):
CORE.data[KEY_ZEPHYR] = {} CORE.data[KEY_ZEPHYR] = {}

View File

@ -9,7 +9,7 @@ from esphome.const import (
) )
from esphome.core import CORE, coroutine_with_priority from esphome.core import CORE, coroutine_with_priority
import esphome.final_validate as fv import esphome.final_validate as fv
from esphome.components.zephyr.const import BOOTLOADER_MCUBOOT from esphome.components.zephyr.const import BOOTLOADER_MCUBOOT, KEY_BOOTLOADER
from esphome.components.zephyr import ( from esphome.components.zephyr import (
zephyr_add_prj_conf, zephyr_add_prj_conf,
zephyr_add_cdc_acm, zephyr_add_cdc_acm,
@ -56,7 +56,7 @@ CONFIG_SCHEMA = cv.All(
def _validate_mcumgr(config): def _validate_mcumgr(config):
fconf = fv.full_config.get() fconf = fv.full_config.get()
try: try:
bootloader = fconf.get_config_for_path(["nrf52", "bootloader"]) bootloader = fconf.get_config_for_path(["nrf52", KEY_BOOTLOADER])
if bootloader != BOOTLOADER_MCUBOOT: if bootloader != BOOTLOADER_MCUBOOT:
raise cv.Invalid(f"'{bootloader}' bootloader does not support OTA") raise cv.Invalid(f"'{bootloader}' bootloader does not support OTA")
except KeyError: except KeyError: