diff --git a/esphome/components/logger/__init__.py b/esphome/components/logger/__init__.py index f8ac71877b..8c840fe970 100644 --- a/esphome/components/logger/__init__.py +++ b/esphome/components/logger/__init__.py @@ -18,11 +18,11 @@ from esphome.const import ( CONF_TRIGGER_ID, CONF_TX_BUFFER_SIZE, PLATFORM_BK72XX, - PLATFORM_RTL87XX, PLATFORM_ESP32, PLATFORM_ESP8266, - PLATFORM_RP2040, PLATFORM_NRF52, + PLATFORM_RP2040, + PLATFORM_RTL87XX, ) from esphome.core import CORE, EsphomeError, Lambda, coroutine_with_priority from esphome.components.esp32 import add_idf_sdkconfig_option, get_esp32_variant diff --git a/esphome/components/nrf52/__init__.py b/esphome/components/nrf52/__init__.py index 7851634919..2886909ea9 100644 --- a/esphome/components/nrf52/__init__.py +++ b/esphome/components/nrf52/__init__.py @@ -2,13 +2,13 @@ import esphome.codegen as cg import esphome.config_validation as cv from esphome.const import ( CONF_BOARD, + CONF_FRAMEWORK, + CONF_PLATFORM_VERSION, + CONF_TYPE, KEY_CORE, KEY_TARGET_FRAMEWORK, KEY_TARGET_PLATFORM, PLATFORM_NRF52, - CONF_TYPE, - CONF_FRAMEWORK, - CONF_PLATFORM_VERSION, ) from esphome.core import CORE, coroutine_with_priority @@ -17,14 +17,12 @@ from esphome.components.zephyr import ( zephyr_to_code, ) from esphome.components.zephyr.const import ( - KEY_ZEPHYR, - KEY_BOOTLOADER, BOOTLOADER_MCUBOOT, + KEY_BOOTLOADER, + KEY_ZEPHYR, ) from .boards_zephyr import BOARDS_ZEPHYR -from .const import ( - BOOTLOADER_ADAFRUIT, -) +from .const import BOOTLOADER_ADAFRUIT # force import gpio to register pin schema from .gpio import nrf52_pin_to_code # noqa diff --git a/esphome/components/nrf52/gpio.py b/esphome/components/nrf52/gpio.py index 4abe8f4d83..a2329be521 100644 --- a/esphome/components/nrf52/gpio.py +++ b/esphome/components/nrf52/gpio.py @@ -4,8 +4,8 @@ import esphome.codegen as cg import esphome.config_validation as cv from esphome.const import ( CONF_ID, - CONF_MODE, CONF_INVERTED, + CONF_MODE, CONF_NUMBER, ) from esphome.components.zephyr.const import ( diff --git a/esphome/components/zephyr/__init__.py b/esphome/components/zephyr/__init__.py index 79a58916ea..20802824e9 100644 --- a/esphome/components/zephyr/__init__.py +++ b/esphome/components/zephyr/__init__.py @@ -11,14 +11,14 @@ from esphome.const import ( KEY_NAME, ) from .const import ( - KEY_ZEPHYR, - KEY_PRJ_CONF, - KEY_OVERLAY, - zephyr_ns, BOOTLOADER_MCUBOOT, - KEY_EXTRA_BUILD_FILES, - KEY_PATH, KEY_BOOTLOADER, + KEY_EXTRA_BUILD_FILES, + KEY_OVERLAY, + KEY_PATH, + KEY_PRJ_CONF, + KEY_ZEPHYR, + zephyr_ns, ) CODEOWNERS = ["@tomaszduda23"] diff --git a/esphome/components/zephyr/const.py b/esphome/components/zephyr/const.py index 1f19d3d8a1..631ab286be 100644 --- a/esphome/components/zephyr/const.py +++ b/esphome/components/zephyr/const.py @@ -1,12 +1,12 @@ import esphome.codegen as cg -KEY_ZEPHYR = "zephyr" -KEY_PRJ_CONF = "prj_conf" -KEY_OVERLAY = "overlay" -KEY_BOOTLOADER = "bootloader" -KEY_EXTRA_BUILD_FILES = "extra_build_files" -KEY_PATH = "path" - BOOTLOADER_MCUBOOT = "mcuboot" +KEY_BOOTLOADER = "bootloader" +KEY_EXTRA_BUILD_FILES = "extra_build_files" +KEY_OVERLAY = "overlay" +KEY_PATH = "path" +KEY_PRJ_CONF = "prj_conf" +KEY_ZEPHYR = "zephyr" + zephyr_ns = cg.esphome_ns.namespace("zephyr") diff --git a/esphome/config_validation.py b/esphome/config_validation.py index b3a9a3a078..ee90a3670b 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -57,12 +57,12 @@ from esphome.const import ( KEY_TARGET_PLATFORM, PLATFORM_ESP32, PLATFORM_ESP8266, + PLATFORM_NRF52, PLATFORM_RP2040, TYPE_GIT, TYPE_LOCAL, VALID_SUBSTITUTIONS_CHARACTERS, __version__ as ESPHOME_VERSION, - PLATFORM_NRF52, ) from esphome.core import ( CORE, diff --git a/esphome/const.py b/esphome/const.py index 7237e697fd..e4bd7aa757 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -7,24 +7,24 @@ VALID_SUBSTITUTIONS_CHARACTERS = ( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" ) +PLATFORM_BK72XX = "bk72xx" PLATFORM_ESP32 = "esp32" PLATFORM_ESP8266 = "esp8266" -PLATFORM_RP2040 = "rp2040" PLATFORM_HOST = "host" -PLATFORM_BK72XX = "bk72xx" -PLATFORM_RTL87XX = "rtl87xx" PLATFORM_LIBRETINY_OLDSTYLE = "libretiny" PLATFORM_NRF52 = "nrf52" +PLATFORM_RP2040 = "rp2040" +PLATFORM_RTL87XX = "rtl87xx" TARGET_PLATFORMS = [ + PLATFORM_BK72XX, PLATFORM_ESP32, PLATFORM_ESP8266, - PLATFORM_RP2040, PLATFORM_HOST, - PLATFORM_BK72XX, - PLATFORM_RTL87XX, PLATFORM_LIBRETINY_OLDSTYLE, PLATFORM_NRF52, + PLATFORM_RP2040, + PLATFORM_RTL87XX, ] SOURCE_FILE_EXTENSIONS = {".cpp", ".hpp", ".h", ".c", ".tcc", ".ino"} diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 3a70fd2c9a..8dfa2f598e 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -15,13 +15,13 @@ from esphome.const import ( KEY_CORE, KEY_TARGET_FRAMEWORK, KEY_TARGET_PLATFORM, + PLATFORM_BK72XX, PLATFORM_ESP32, PLATFORM_ESP8266, - PLATFORM_BK72XX, - PLATFORM_RTL87XX, - PLATFORM_RP2040, PLATFORM_HOST, PLATFORM_NRF52, + PLATFORM_RP2040, + PLATFORM_RTL87XX, ) from esphome.coroutine import FakeAwaitable as _FakeAwaitable from esphome.coroutine import FakeEventLoop as _FakeEventLoop