From 12230ce4d74cf8740881f8c039b001ad4daee147 Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Wed, 8 May 2024 23:49:26 +0200 Subject: [PATCH] remove duplicate keys --- esphome/components/zephyr/__init__.py | 3 +-- esphome/components/zephyr_mcumgr/ota/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/zephyr/__init__.py b/esphome/components/zephyr/__init__.py index 0c687daabd..d8f8718e9c 100644 --- a/esphome/components/zephyr/__init__.py +++ b/esphome/components/zephyr/__init__.py @@ -21,14 +21,13 @@ from .const import ( BOOTLOADER_MCUBOOT, KEY_EXTRA_BUILD_FILES, KEY_PATH, + KEY_BOOTLOADER, ) AUTO_LOAD = ["preferences"] KEY_BOARD = "board" -KEY_BOOTLOADER = "bootloader" - def zephyr_set_core_data(config): CORE.data[KEY_ZEPHYR] = {} diff --git a/esphome/components/zephyr_mcumgr/ota/__init__.py b/esphome/components/zephyr_mcumgr/ota/__init__.py index 9350266480..6530bf726f 100644 --- a/esphome/components/zephyr_mcumgr/ota/__init__.py +++ b/esphome/components/zephyr_mcumgr/ota/__init__.py @@ -9,7 +9,7 @@ from esphome.const import ( ) from esphome.core import CORE, coroutine_with_priority 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 ( zephyr_add_prj_conf, zephyr_add_cdc_acm, @@ -56,7 +56,7 @@ CONFIG_SCHEMA = cv.All( def _validate_mcumgr(config): fconf = fv.full_config.get() try: - bootloader = fconf.get_config_for_path(["nrf52", "bootloader"]) + bootloader = fconf.get_config_for_path(["nrf52", KEY_BOOTLOADER]) if bootloader != BOOTLOADER_MCUBOOT: raise cv.Invalid(f"'{bootloader}' bootloader does not support OTA") except KeyError: