From ded94c6698d53291b8bce03fffc0af2133e570bd Mon Sep 17 00:00:00 2001 From: mrtoy-me <118446898+mrtoy-me@users.noreply.github.com> Date: Wed, 21 Oct 2026 12:50:49 +1000 Subject: [PATCH] [sx126x][sx127x] Move CONF_MODULATION to the shared component constants (#21249) --- esphome/components/const/__init__.py | 1 + esphome/components/sx126x/__init__.py | 8 ++++++-- esphome/components/sx127x/__init__.py | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/esphome/components/const/__init__.py b/esphome/components/const/__init__.py index b5f2a563d08..b0256c1e99f 100644 --- a/esphome/components/const/__init__.py +++ b/esphome/components/const/__init__.py @@ -50,6 +50,7 @@ CONF_LIBRETINY = "libretiny" CONF_LOOP = "loop" CONF_MANUFACTURER = "manufacturer" CONF_MAX_PACKET_SIZE = "max_packet_size" +CONF_MODULATION = "modulation" CONF_NOX_INDEX = "nox_index" CONF_ON_PACKET = "on_packet" CONF_ON_RECEIVE = "on_receive" diff --git a/esphome/components/sx126x/__init__.py b/esphome/components/sx126x/__init__.py index 3a028b8dfb9..c5671605954 100644 --- a/esphome/components/sx126x/__init__.py +++ b/esphome/components/sx126x/__init__.py @@ -3,7 +3,12 @@ from typing import Any from esphome import automation, pins import esphome.codegen as cg from esphome.components import spi -from esphome.components.const import CONF_CRC_ENABLE, CONF_ON_PACKET, CONF_RST_PIN +from esphome.components.const import ( + CONF_CRC_ENABLE, + CONF_MODULATION, + CONF_ON_PACKET, + CONF_RST_PIN, +) import esphome.config_validation as cv from esphome.const import CONF_BUSY_PIN, CONF_DATA, CONF_FREQUENCY, CONF_ID from esphome.core import ID, TimePeriod @@ -28,7 +33,6 @@ CONF_CRC_INITIAL = "crc_initial" CONF_DEVIATION = "deviation" CONF_DIO1_PIN = "dio1_pin" CONF_HW_VERSION = "hw_version" -CONF_MODULATION = "modulation" CONF_PA_POWER = "pa_power" CONF_PA_RAMP = "pa_ramp" CONF_PAYLOAD_LENGTH = "payload_length" diff --git a/esphome/components/sx127x/__init__.py b/esphome/components/sx127x/__init__.py index 65d3ada470b..534c2498e77 100644 --- a/esphome/components/sx127x/__init__.py +++ b/esphome/components/sx127x/__init__.py @@ -3,7 +3,12 @@ from typing import Any from esphome import automation, pins import esphome.codegen as cg from esphome.components import spi -from esphome.components.const import CONF_CRC_ENABLE, CONF_ON_PACKET, CONF_RST_PIN +from esphome.components.const import ( + CONF_CRC_ENABLE, + CONF_MODULATION, + CONF_ON_PACKET, + CONF_RST_PIN, +) import esphome.config_validation as cv from esphome.const import CONF_DATA, CONF_FREQUENCY, CONF_ID from esphome.core import ID @@ -24,7 +29,6 @@ CONF_BITSYNC = "bitsync" CONF_CODING_RATE = "coding_rate" CONF_DEVIATION = "deviation" CONF_DIO0_PIN = "dio0_pin" -CONF_MODULATION = "modulation" CONF_PA_PIN = "pa_pin" CONF_PA_POWER = "pa_power" CONF_PA_RAMP = "pa_ramp"