From bf48b0736e1660163331e4e1f5134787383bfed8 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda Date: Thu, 31 Oct 2024 21:24:28 -0400 Subject: [PATCH] Reorder --- esphome/components/sx127x/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/sx127x/__init__.py b/esphome/components/sx127x/__init__.py index e843abf1a8..9fec44865c 100644 --- a/esphome/components/sx127x/__init__.py +++ b/esphome/components/sx127x/__init__.py @@ -135,12 +135,12 @@ def validate_config(config): raise cv.Invalid("PA power must be <= 15 dbm when using the RFO pin") if config[CONF_PA_PIN] == "BOOST" and config[CONF_PA_POWER] < 2: raise cv.Invalid("PA power must be >= 2 dbm when using the BOOST pin") + if CONF_BITSYNC in config and CONF_BITRATE not in config: + raise cv.Invalid("Bitsync is configured but not bitrate") if CONF_BITRATE in config and CONF_BITSYNC not in config: raise cv.Invalid( "Bitrate is configured but not bitsync; add 'bitsync: true' for original functionality" ) - if CONF_BITSYNC in config and CONF_BITRATE not in config: - raise cv.Invalid("Bitsync is configured but not bitrate") return config