1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

Add Event Component to UART (#11765)

Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
eoasmxd
2025-12-23 06:19:48 +08:00
committed by GitHub
parent af0d4d2c2c
commit 1b31253287
6 changed files with 186 additions and 0 deletions

View File

@@ -75,3 +75,11 @@ button:
- uart.write: !lambda |-
std::string cmd = "VALUE=" + str_sprintf("%.0f", id(test_number).state) + "\r\n";
return std::vector<uint8_t>(cmd.begin(), cmd.end());
event:
- platform: uart
uart_id: uart_uart
name: "UART Event"
event_types:
- "string_event_A": "*A#"
- "bytes_event_B": [0x2A, 0x42, 0x23]

View File

@@ -31,3 +31,11 @@ button:
name: "UART Button"
uart_id: uart_uart
data: [0xFF, 0xEE]
event:
- platform: uart
uart_id: uart_uart
name: "UART Event"
event_types:
- "string_event_A": "*A#"
- "bytes_event_B": [0x2A, 0x42, 0x23]