Update the patched UART component to ESPHome 2026.11.0

ESPHome 2026.11's tuya component calls uart.new_uart_component(), which the
2026.10.2 copy didn't have, so the build failed. Copy the UART component from
2026.11.0, reapply the PA13/PA14 patch, regenerate the patch file and point
the refs at v1.0.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-11-19 00:31:45 +01:00
1 parent bcc6b3a42b
commit 1457e25d98
39 files changed
+907 -304

No files matched your search

+16 -21
View File
@@ -1,10 +1,10 @@
from esphome import automation
import esphome.codegen as cg
from esphome.components import switch, uart
import esphome.config_validation as cv
from esphome.const import CONF_DATA, CONF_SEND_EVERY
from esphome.core import HexInt
from .. import uart_ns, validate_raw_data
from .. import uart_ns, validate_raw_payload
DEPENDENCIES = ["uart"]
@@ -18,11 +18,11 @@ CONFIG_SCHEMA = (
.extend(
{
cv.Required(CONF_DATA): cv.Any(
validate_raw_data,
validate_raw_payload,
cv.Schema(
{
cv.Optional(CONF_TURN_OFF): validate_raw_data,
cv.Optional(CONF_TURN_ON): validate_raw_data,
cv.Optional(CONF_TURN_OFF): validate_raw_payload,
cv.Optional(CONF_TURN_ON): validate_raw_payload,
}
),
),
@@ -40,20 +40,15 @@ async def to_code(config):
await uart.register_uart_device(var, config)
data = config[CONF_DATA]
if isinstance(data, dict):
if data_on := data.get(CONF_TURN_ON):
if isinstance(data_on, bytes):
data_on = [HexInt(x) for x in data_on]
cg.add(var.set_data_on(cg.ArrayInitializer(*data_on)))
if data_off := data.get(CONF_TURN_OFF):
if isinstance(data_off, bytes):
data_off = [HexInt(x) for x in data_off]
cg.add(var.set_data_off(cg.ArrayInitializer(*data_off)))
else:
data = config[CONF_DATA]
if isinstance(data, bytes):
data = [HexInt(x) for x in data]
cg.add(var.set_data_on(cg.ArrayInitializer(*data)))
single_state = not isinstance(data, dict)
if single_state:
data = {CONF_TURN_ON: data}
for key, setter in (
(CONF_TURN_ON, var.set_data_on),
(CONF_TURN_OFF, var.set_data_off),
):
if payload := data.get(key):
cg.add(setter(automation.progmem_bytes("uart_data", payload), len(payload)))
if single_state:
cg.add(var.set_single_state(True))
if CONF_SEND_EVERY in config:
cg.add(var.set_send_every(config[CONF_SEND_EVERY]))
cg.add_optional(var.set_send_every, config.get(CONF_SEND_EVERY))