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", "open",
"setup", "setup",
"loop", "loop",
"uart0",
"uart1",
"uart2",
] ]

View file

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

View file

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

View file

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