[micronova] Add FINAL_VALIDATE_SCHEMA to validate uart (#12350)

Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
Robert Resch
2025-12-08 03:02:05 +01:00
committed by GitHub
parent e36e6fbc3f
commit c5cc91f6f0
10 changed files with 94 additions and 5 deletions

View File

@@ -8,13 +8,14 @@ CODEOWNERS = ["@jorre05", "@edenhaus"]
DEPENDENCIES = ["uart"]
CONF_MICRONOVA_ID = "micronova_id"
DOMAIN = "micronova"
CONF_MICRONOVA_ID = f"{DOMAIN}_id"
CONF_ENABLE_RX_PIN = "enable_rx_pin"
CONF_MEMORY_LOCATION = "memory_location"
CONF_MEMORY_ADDRESS = "memory_address"
DEFAULT_POLLING_INTERVAL = "60s"
micronova_ns = cg.esphome_ns.namespace("micronova")
micronova_ns = cg.esphome_ns.namespace(DOMAIN)
MicroNovaFunctions = micronova_ns.enum("MicroNovaFunctions", is_class=True)
MICRONOVA_FUNCTIONS_ENUM = {
@@ -42,6 +43,16 @@ CONFIG_SCHEMA = cv.Schema(
}
).extend(uart.UART_DEVICE_SCHEMA)
FINAL_VALIDATE_SCHEMA = uart.final_validate_device_schema(
DOMAIN,
baud_rate=1200,
require_rx=True,
require_tx=True,
data_bits=8,
parity="NONE",
stop_bits=2,
)
def MICRONOVA_ADDRESS_SCHEMA(
*,

View File

@@ -2,6 +2,6 @@ substitutions:
enable_rx_pin: GPIO13
packages:
uart: !include ../../test_build_components/common/uart/esp32-idf.yaml
uart: !include ../../test_build_components/common/uart_1200_none_2stopbits/esp32-idf.yaml
<<: !include common.yaml

View File

@@ -2,6 +2,6 @@ substitutions:
enable_rx_pin: GPIO15
packages:
uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml
uart: !include ../../test_build_components/common/uart_1200_none_2stopbits/esp8266-ard.yaml
<<: !include common.yaml

View File

@@ -2,6 +2,6 @@ substitutions:
enable_rx_pin: GPIO3
packages:
uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml
uart: !include ../../test_build_components/common/uart_1200_none_2stopbits/rp2040-ard.yaml
<<: !include common.yaml

View File

@@ -0,0 +1,13 @@
# Common UART configuration for ESP32 Arduino tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO17
rx_pin: GPIO16
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2

View File

@@ -0,0 +1,13 @@
# Common UART configuration for ESP32-C3 Arduino tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO20
rx_pin: GPIO21
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2

View File

@@ -0,0 +1,13 @@
# Common UART configuration for ESP32-C3 IDF tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO20
rx_pin: GPIO21
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2

View File

@@ -0,0 +1,13 @@
# Common UART configuration for ESP32 IDF tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO17
rx_pin: GPIO16
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2

View File

@@ -0,0 +1,13 @@
# Common UART configuration for ESP8266 Arduino tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO4
rx_pin: GPIO5
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2

View File

@@ -0,0 +1,13 @@
# Common UART configuration for RP2040 Arduino tests - 1200 baud NONE parity 2 stop bits
substitutions:
tx_pin: GPIO0
rx_pin: GPIO1
uart:
- id: uart_bus
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 1200
parity: NONE
stop_bits: 2