From 5a2c000bc49094c95e46b90ffe2ab56d35251315 Mon Sep 17 00:00:00 2001 From: Bonne Eggleston Date: Tue, 21 Jan 2025 23:20:44 -0800 Subject: [PATCH] Fix python lint --- esphome/components/modbus/__init__.py | 2 +- esphome/components/uart/__init__.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/esphome/components/modbus/__init__.py b/esphome/components/modbus/__init__.py index 0b6fd0c0d1..4f00eec78f 100644 --- a/esphome/components/modbus/__init__.py +++ b/esphome/components/modbus/__init__.py @@ -12,7 +12,6 @@ from esphome.const import ( CONF_ADDRESS, CONF_DISABLE_CRC, ) -from esphome.core import CORE from esphome import pins DEPENDENCIES = ["uart"] @@ -52,6 +51,7 @@ CONFIG_SCHEMA = ( .extend(uart.UART_DEVICE_SCHEMA) ) + async def to_code(config): cg.add_global(modbus_ns.using) var = cg.new_Pvariable(config[CONF_ID]) diff --git a/esphome/components/uart/__init__.py b/esphome/components/uart/__init__.py index 289e5a5ad0..2f375cb207 100644 --- a/esphome/components/uart/__init__.py +++ b/esphome/components/uart/__init__.py @@ -248,8 +248,12 @@ CONFIG_SCHEMA = cv.All( cv.Optional(CONF_PARITY, default="NONE"): cv.enum( UART_PARITY_OPTIONS, upper=True ), - cv.Optional(CONF_RX_FULL_THRESHOLD): cv.All(cv.int_range(min=1, max=120), cv.only_on_esp32), - cv.Optional(CONF_RX_TIMEOUT): cv.All(cv.int_range(min=0, max=126), cv.only_on_esp32), + cv.Optional(CONF_RX_FULL_THRESHOLD): cv.All( + cv.int_range(min=1, max=120), cv.only_on_esp32 + ), + cv.Optional(CONF_RX_TIMEOUT): cv.All( + cv.int_range(min=0, max=126), cv.only_on_esp32 + ), cv.Optional(CONF_INVERT): cv.invalid( "This option has been removed. Please instead use invert in the tx/rx pin schemas." ),