[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.
This commit is contained in:
kbx81
2026-09-02 14:25:13 -05:00
parent 5e79c617e8
commit f14d69ff36
+1 -16
View File
@@ -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,