Disallow uart0/1/2 as ids in config (#4446)

* Disallow uart0/1/2 as ids in config

* Update test files
This commit is contained in:
Jesse Hills 2023-03-20 15:29:21 +13:00 committed by GitHub
parent 0b383542da
commit f0f6d3f1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 56 deletions

View File

@ -211,6 +211,9 @@ RESERVED_IDS = [
"open",
"setup",
"loop",
"uart0",
"uart1",
"uart2",
]

View File

@ -161,13 +161,13 @@ mqtt:
id: ${roomname}_lights
relative_brightness: 5%
- uart.write:
id: uart0
id: uart_0
data: Hello World
- uart.write:
id: uart0
id: uart_0
data: [0x00, 0x20, 0x30]
- uart.write:
id: uart0
id: uart_0
data: !lambda |-
return {};
on_connect:
@ -199,7 +199,7 @@ uart:
number: GPIO23
inverted: true
baud_rate: 115200
id: uart0
id: uart_0
parity: NONE
data_bits: 8
stop_bits: 1
@ -790,7 +790,7 @@ sensor:
reference_resistance: 430 Ω
rtd_nominal_resistance: 100 Ω
- platform: mhz19
uart_id: uart0
uart_id: uart_0
co2:
name: MH-Z19 CO2 Value
temperature:
@ -930,7 +930,7 @@ sensor:
name: Pulse Width
pin: GPIO12
- platform: sm300d2
uart_id: uart0
uart_id: uart_0
co2:
name: SM300D2 CO2 Value
formaldehyde:
@ -1122,7 +1122,7 @@ sensor:
root["key"] = id(the_sensor).state;
root["greeting"] = "Hello World";
- platform: sds011
uart_id: uart0
uart_id: uart_0
pm_2_5:
name: SDS011 PM2.5
pm_10_0:
@ -2094,7 +2094,7 @@ climate:
on_state:
logger.log: State changed!
id: midea_unit
uart_id: uart0
uart_id: uart_0
name: Midea Climate
transmitter_id:
period: 1s
@ -2419,15 +2419,15 @@ switch:
id: my_switch
state: !lambda "return false;"
- platform: uart
uart_id: uart0
uart_id: uart_0
name: UART String Output
data: DataToSend
- platform: uart
uart_id: uart0
uart_id: uart_0
name: UART Bytes Output
data: [0xDE, 0xAD, 0xBE, 0xEF]
- platform: uart
uart_id: uart0
uart_id: uart_0
name: UART Recurring Output
data: [0xDE, 0xAD, 0xBE, 0xEF]
send_every: 1s
@ -2775,7 +2775,7 @@ pn532_i2c:
i2c_id: i2c_bus
rdm6300:
uart_id: uart0
uart_id: uart_0
rc522_spi:
cs_pin: GPIO23
@ -2804,7 +2804,7 @@ mcp4728:
i2c_id: i2c_bus
gps:
uart_id: uart0
uart_id: uart_0
time:
- platform: sntp
@ -3124,7 +3124,7 @@ canbus:
teleinfo:
id: myteleinfo
uart_id: uart0
uart_id: uart_0
update_interval: 60s
historical_mode: true

View File

@ -216,37 +216,37 @@ wifi:
password: "password1"
uart:
- id: uart1
- id: uart_1
tx_pin:
number: GPIO1
inverted: true
rx_pin: GPIO3
baud_rate: 115200
- id: uart2
- id: uart_2
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart3
- id: uart_3
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 4800
- id: uart4
- id: uart_4
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart5
- id: uart_5
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart6
- id: uart_6
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart7
- id: uart_7
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 38400
- id: uart8
- id: uart_8
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 4800
@ -254,28 +254,28 @@ uart:
stop_bits: 2
# Specifically added for testing debug with no options at all.
debug:
- id: uart9
- id: uart_9
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart10
- id: uart_10
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart11
- id: uart_11
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
- id: uart12
- id: uart_12
tx_pin: GPIO4
rx_pin: GPIO5
baud_rate: 9600
modbus:
uart_id: uart1
uart_id: uart_1
vbus:
uart_id: uart4
uart_id: uart_4
ota:
safe_mode: true
@ -337,14 +337,14 @@ sensor:
- platform: hydreon_rgxx
model: RG 9
uart_id: uart6
uart_id: uart_6
id: hydreon_rg9
moisture:
name: hydreon_rain
id: hydreon_rain
- platform: hydreon_rgxx
model: RG_15
uart_id: uart6
uart_id: uart_6
acc:
name: hydreon_acc
event_acc:
@ -369,7 +369,7 @@ sensor:
value: 100.0
- platform: bl0939
uart_id: uart8
uart_id: uart_8
voltage:
name: BL0939 Voltage
current_1:
@ -387,7 +387,7 @@ sensor:
energy_total:
name: BL0939 Total energy
- platform: bl0940
uart_id: uart3
uart_id: uart_3
voltage:
name: BL0940 Voltage
current:
@ -401,7 +401,7 @@ sensor:
external_temperature:
name: BL0940 External temperature
- platform: bl0942
uart_id: uart3
uart_id: uart_3
voltage:
name: BL0942 Voltage
current:
@ -413,7 +413,7 @@ sensor:
frequency:
name: BL0942 Frequency
- platform: pzem004t
uart_id: uart3
uart_id: uart_3
voltage:
name: PZEM004T Voltage
current:
@ -446,7 +446,7 @@ sensor:
name: PZEMDC Energy
- platform: pmsx003
uart_id: uart9
uart_id: uart_9
type: PMSX003
pm_1_0:
name: PM 1.0 Concentration
@ -474,7 +474,7 @@ sensor:
name: Particulate Count >10.0um
update_interval: 30s
- platform: pmsx003
uart_id: uart5
uart_id: uart_5
type: PMS5003T
pm_1_0:
name: PM 1.0 Concentration
@ -501,7 +501,7 @@ sensor:
humidity:
name: PMS Humidity
- platform: pmsx003
uart_id: uart6
uart_id: uart_6
type: PMS5003ST
pm_1_0:
name: PM 1.0 Concentration
@ -534,7 +534,7 @@ sensor:
formaldehyde:
name: PMS Formaldehyde Concentration
- platform: cse7761
uart_id: uart7
uart_id: uart_7
voltage:
name: CSE7761 Voltage
current_1:
@ -546,7 +546,7 @@ sensor:
active_power_2:
name: CSE7761 Active Power 2
- platform: cse7766
uart_id: uart3
uart_id: uart_3
voltage:
name: CSE7766 Voltage
current:
@ -637,7 +637,7 @@ sensor:
component_id: 2
wave_channel_id: 1
- platform: smt100
uart_id: uart10
uart_id: uart_10
counts:
name: Counts
dielectric_constant:
@ -925,7 +925,7 @@ climate:
- horizontal
- both
update_interval: 10s
uart_id: uart12
uart_id: uart_12
sprinkler:
- id: yard_sprinkler_ctrlr
@ -996,7 +996,7 @@ light:
effects:
- wled:
- adalight:
uart_id: uart3
uart_id: uart_3
- e131:
universe: 1
- platform: hbridge
@ -1004,7 +1004,7 @@ light:
pin_a: out
pin_b: out2
- platform: sonoff_d1
uart_id: uart2
uart_id: uart_2
use_rm433_remote: false
name: Sonoff D1 Dimmer
id: d1_light
@ -1019,10 +1019,10 @@ light:
name: "Shelly Dimmer Current"
max_brightness: 500
firmware: "51.6"
uart_id: uart11
uart_id: uart_11
sim800l:
uart_id: uart4
uart_id: uart_4
on_sms_received:
- lambda: |-
std::string str;
@ -1035,7 +1035,7 @@ sim800l:
recipient: "+1234"
dfplayer:
uart_id: uart5
uart_id: uart_5
on_finished_playback:
then:
if:
@ -1049,7 +1049,7 @@ tm1651:
dio_pin: D5
rf_bridge:
uart_id: uart5
uart_id: uart_5
on_code_received:
- lambda: |-
uint32_t test;
@ -1083,7 +1083,7 @@ rf_bridge:
display:
- platform: nextion
uart_id: uart1
uart_id: uart_1
tft_url: http://esphome.io/default35.tft
update_interval: 5s
on_sleep:
@ -1128,11 +1128,11 @@ fingerprint_grow:
event: esphome.${device_name}_fingerprint_grow_enrollment_failed
data:
finger_id: !lambda "return finger_id;"
uart_id: uart6
uart_id: uart_6
dsmr:
decryption_key: 00112233445566778899aabbccddeeff
uart_id: uart6
uart_id: uart_6
max_telegram_length: 1000
request_pin: D5
request_interval: 20s
@ -1140,7 +1140,7 @@ dsmr:
daly_bms:
update_interval: 20s
uart_id: uart1
uart_id: uart_1
qr_code:
- id: homepage_qr

View File

@ -29,11 +29,11 @@ ota:
logger:
uart:
- id: uart1
- id: uart_1
tx_pin: 1
rx_pin: 3
baud_rate: 9600
- id: uart2
- id: uart_2
tx_pin: 17
rx_pin: 16
baud_rate: 19200
@ -42,7 +42,7 @@ i2c:
frequency: 100khz
modbus:
uart_id: uart1
uart_id: uart_1
flow_control_pin: 5
id: mod_bus1
@ -67,7 +67,7 @@ mqtt:
# yamllint enable rule:line-length
vbus:
- uart_id: uart2
- uart_id: uart_2
binary_sensor:
- platform: gpio
@ -422,7 +422,7 @@ sensor:
value_type: U_WORD
- platform: t6615
uart_id: uart2
uart_id: uart_2
co2:
name: CO2 Sensor