From f14d69ff364ef20e5d17cd686663006c8d945f47 Mon Sep 17 00:00:00 2001 From: kbx81 Date: Wed, 2 Sep 2026 14:25:13 -0500 Subject: [PATCH] [usb_uart] Drop unused is_usb_uart_channel helper Its only caller was removed when zigbee_proxy switched to observing a serial_proxy port instead of owning the UART. --- esphome/components/usb_uart/__init__.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/esphome/components/usb_uart/__init__.py b/esphome/components/usb_uart/__init__.py index 0863bf0e2c..edbf75f70f 100644 --- a/esphome/components/usb_uart/__init__.py +++ b/esphome/components/usb_uart/__init__.py @@ -16,7 +16,7 @@ from esphome.const import ( CONF_DUMMY_RECEIVER, CONF_ID, ) -from esphome.core import CORE, ID +from esphome.core import CORE from esphome.cpp_types import Component from esphome.types import ConfigType @@ -27,21 +27,6 @@ usb_uart_ns = cg.esphome_ns.namespace("usb_uart") USBUartComponent = usb_uart_ns.class_("USBUartComponent", Component) USBUartChannel = usb_uart_ns.class_("USBUartChannel", UARTComponent) - -def is_usb_uart_channel(uart_id: ID) -> bool: - """Return True if the given ID refers to a channel of a configured usb_uart device. - - Lets UART device components detect that their uart_id points at a USB UART - channel (use_id resolution does not narrow the ID's type) so they can enable - USB-specific features such as the RX callback. - """ - return any( - channel[CONF_ID] == uart_id - for device in CORE.config.get("usb_uart") or [] - for channel in device[CONF_CHANNELS] - ) - - UARTParityOptions = usb_uart_ns.enum("UARTParityOptions") UART_PARITY_OPTIONS = { "NONE": UARTParityOptions.UART_CONFIG_PARITY_NONE,