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:
1 parent
bcc6b3a42b
commit
1457e25d98
39 files changed
+907
-304
No files matched your search
@@ -1,36 +1,29 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome import automation
|
||||
from esphome.components import button, uart
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DATA
|
||||
from esphome.core import HexInt
|
||||
from esphome.const import CONF_DATA, CONF_UART_ID
|
||||
from esphome.types import ConfigType
|
||||
|
||||
from .. import uart_ns, validate_raw_data
|
||||
from .. import validate_raw_payload
|
||||
|
||||
CODEOWNERS = ["@ssieb"]
|
||||
|
||||
DEPENDENCIES = ["uart"]
|
||||
|
||||
UARTButton = uart_ns.class_("UARTButton", button.Button, uart.UARTDevice, cg.Component)
|
||||
|
||||
|
||||
CONFIG_SCHEMA = (
|
||||
button.button_schema(UARTButton)
|
||||
button.button_schema(button.ApplyButton)
|
||||
.extend(
|
||||
{
|
||||
cv.Required(CONF_DATA): validate_raw_data,
|
||||
cv.Required(CONF_DATA): validate_raw_payload,
|
||||
}
|
||||
)
|
||||
.extend(uart.UART_DEVICE_SCHEMA)
|
||||
.extend(cv.COMPONENT_SCHEMA)
|
||||
)
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
var = await button.new_button(config)
|
||||
await cg.register_component(var, config)
|
||||
await uart.register_uart_device(var, config)
|
||||
|
||||
async def to_code(config: ConfigType) -> None:
|
||||
data = config[CONF_DATA]
|
||||
if isinstance(data, bytes):
|
||||
data = [HexInt(x) for x in data]
|
||||
cg.add(var.set_data(cg.ArrayInitializer(*data)))
|
||||
table = automation.progmem_bytes("uart_data", data)
|
||||
await button.sub_buttons(config, parent=config[CONF_UART_ID]).create(
|
||||
config, None, apply=f"write_array_progmem({table}, {len(data)})"
|
||||
)
|
||||
Reference in new issue
Block a user