From 211aee91e53db1923611c422b3f5ae795ba06aee Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Tue, 4 Feb 2025 17:05:45 -0600 Subject: [PATCH] [CI] Consolidate some tests (G) (#8196) --- tests/components/gcja5/common.yaml | 25 ++++ tests/components/gcja5/test.esp32-ard.yaml | 28 +--- tests/components/gcja5/test.esp32-c3-ard.yaml | 28 +--- tests/components/gcja5/test.esp32-c3-idf.yaml | 28 +--- tests/components/gcja5/test.esp32-idf.yaml | 28 +--- tests/components/gcja5/test.esp8266-ard.yaml | 28 +--- tests/components/gcja5/test.rp2040-ard.yaml | 28 +--- tests/components/gdk101/common.yaml | 7 +- tests/components/gdk101/test.esp32-ard.yaml | 4 +- tests/components/gdk101/test.esp32-idf.yaml | 4 +- tests/components/gdk101/test.esp8266-ard.yaml | 4 +- tests/components/gdk101/test.rp2040-ard.yaml | 4 +- tests/components/gp2y1010au0f/common.yaml | 15 +++ .../gp2y1010au0f/test.esp32-ard.yaml | 5 + .../gp2y1010au0f/test.esp32-c3-ard.yaml | 5 + .../gp2y1010au0f/test.esp32-c3-idf.yaml | 5 + .../gp2y1010au0f/test.esp32-idf.yaml | 19 +-- .../gp2y1010au0f/test.esp8266-ard.yaml | 5 + .../gp2y1010au0f/test.rp2040-ard.yaml | 5 + tests/components/gp8403/common.yaml | 20 +++ tests/components/gp8403/test.esp32-ard.yaml | 23 +--- .../components/gp8403/test.esp32-c3-ard.yaml | 23 +--- .../components/gp8403/test.esp32-c3-idf.yaml | 23 +--- tests/components/gp8403/test.esp32-idf.yaml | 23 +--- tests/components/gp8403/test.esp8266-ard.yaml | 23 +--- tests/components/gp8403/test.rp2040-ard.yaml | 23 +--- tests/components/gpio/common.yaml | 14 ++ tests/components/gpio/test.esp32-ard.yaml | 18 +-- tests/components/gpio/test.esp32-c3-ard.yaml | 18 +-- tests/components/gpio/test.esp32-c3-idf.yaml | 18 +-- tests/components/gpio/test.esp32-idf.yaml | 18 +-- tests/components/gpio/test.esp8266-ard.yaml | 18 +-- tests/components/gpio/test.rp2040-ard.yaml | 18 +-- tests/components/gps/common.yaml | 14 ++ tests/components/gps/test.esp32-ard.yaml | 17 +-- tests/components/gps/test.esp32-c3-ard.yaml | 17 +-- tests/components/gps/test.esp8266-ard.yaml | 17 +-- tests/components/gps/test.rp2040-ard.yaml | 17 +-- tests/components/graph/common.yaml | 25 ++++ tests/components/graph/test.esp32-ard.yaml | 29 +--- tests/components/graph/test.esp32-c3-ard.yaml | 29 +--- tests/components/graph/test.esp32-c3-idf.yaml | 29 +--- tests/components/graph/test.esp32-idf.yaml | 29 +--- tests/components/graph/test.esp8266-ard.yaml | 29 +--- tests/components/graph/test.rp2040-ard.yaml | 29 +--- .../graphical_display_menu/common.yaml | 120 +++++++++++++++++ .../test.esp32-ard.yaml | 124 +----------------- .../test.esp32-c3-ard.yaml | 124 +----------------- .../test.esp32-c3-idf.yaml | 124 +----------------- .../test.esp32-idf.yaml | 124 +----------------- .../test.esp8266-ard.yaml | 124 +----------------- .../test.rp2040-ard.yaml | 124 +----------------- tests/components/gree/common.yaml | 8 ++ tests/components/gree/test.esp32-ard.yaml | 10 +- tests/components/gree/test.esp32-c3-ard.yaml | 10 +- tests/components/gree/test.esp32-c3-idf.yaml | 10 +- tests/components/gree/test.esp32-idf.yaml | 10 +- tests/components/gree/test.esp8266-ard.yaml | 10 +- tests/components/grove_gas_mc_v2/common.yaml | 6 +- .../grove_gas_mc_v2/test.esp32-ard.yaml | 7 +- .../grove_gas_mc_v2/test.esp32-c3-ard.yaml | 5 + .../grove_gas_mc_v2/test.esp32-c3-idf.yaml | 5 + .../grove_gas_mc_v2/test.esp32-idf.yaml | 7 +- .../grove_gas_mc_v2/test.esp8266-ard.yaml | 7 +- .../grove_gas_mc_v2/test.rp2040-ard.yaml | 7 +- tests/components/grove_tb6612fng/common.yaml | 23 ++++ .../grove_tb6612fng/test.esp32-ard.yaml | 26 +--- .../grove_tb6612fng/test.esp32-c3-ard.yaml | 26 +--- .../grove_tb6612fng/test.esp32-c3-idf.yaml | 26 +--- .../grove_tb6612fng/test.esp32-idf.yaml | 26 +--- .../grove_tb6612fng/test.esp8266-ard.yaml | 26 +--- .../grove_tb6612fng/test.rp2040-ard.yaml | 26 +--- tests/components/growatt_solar/common.yaml | 62 +++++++++ .../growatt_solar/test.esp32-ard.yaml | 66 +--------- .../growatt_solar/test.esp32-c3-ard.yaml | 66 +--------- .../growatt_solar/test.esp32-c3-idf.yaml | 66 +--------- .../growatt_solar/test.esp32-idf.yaml | 66 +--------- .../growatt_solar/test.esp8266-ard.yaml | 66 +--------- .../growatt_solar/test.rp2040-ard.yaml | 66 +--------- 79 files changed, 616 insertions(+), 1823 deletions(-) create mode 100644 tests/components/gcja5/common.yaml create mode 100644 tests/components/gp2y1010au0f/common.yaml create mode 100644 tests/components/gp2y1010au0f/test.esp32-ard.yaml create mode 100644 tests/components/gp2y1010au0f/test.esp32-c3-ard.yaml create mode 100644 tests/components/gp2y1010au0f/test.esp32-c3-idf.yaml create mode 100644 tests/components/gp2y1010au0f/test.esp8266-ard.yaml create mode 100644 tests/components/gp2y1010au0f/test.rp2040-ard.yaml create mode 100644 tests/components/gp8403/common.yaml create mode 100644 tests/components/gpio/common.yaml create mode 100644 tests/components/gps/common.yaml create mode 100644 tests/components/graph/common.yaml create mode 100644 tests/components/graphical_display_menu/common.yaml create mode 100644 tests/components/gree/common.yaml create mode 100644 tests/components/grove_gas_mc_v2/test.esp32-c3-ard.yaml create mode 100644 tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml create mode 100644 tests/components/grove_tb6612fng/common.yaml create mode 100644 tests/components/growatt_solar/common.yaml diff --git a/tests/components/gcja5/common.yaml b/tests/components/gcja5/common.yaml new file mode 100644 index 0000000000..8f6250045d --- /dev/null +++ b/tests/components/gcja5/common.yaml @@ -0,0 +1,25 @@ +uart: + - id: uart_gcja5 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN + +sensor: + - platform: gcja5 + pm_1_0: + name: "Particulate Matter <1.0µm Concentration" + pm_2_5: + name: "Particulate Matter <2.5µm Concentration" + pm_10_0: + name: "Particulate Matter <10.0µm Concentration" + pmc_0_5: + name: "PMC 0.5" + pmc_1_0: + name: "PMC 1.0" + pmc_2_5: + name: "PMC 2.5" + pmc_5_0: + name: "PMC 5.0" + pmc_10_0: + name: "PMC 10.0" diff --git a/tests/components/gcja5/test.esp32-ard.yaml b/tests/components/gcja5/test.esp32-ard.yaml index bc0f89eb9e..811f6b72a6 100644 --- a/tests/components/gcja5/test.esp32-ard.yaml +++ b/tests/components/gcja5/test.esp32-ard.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 17 - rx_pin: 16 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gcja5/test.esp32-c3-ard.yaml b/tests/components/gcja5/test.esp32-c3-ard.yaml index ec8765be52..b516342f3b 100644 --- a/tests/components/gcja5/test.esp32-c3-ard.yaml +++ b/tests/components/gcja5/test.esp32-c3-ard.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gcja5/test.esp32-c3-idf.yaml b/tests/components/gcja5/test.esp32-c3-idf.yaml index ec8765be52..b516342f3b 100644 --- a/tests/components/gcja5/test.esp32-c3-idf.yaml +++ b/tests/components/gcja5/test.esp32-c3-idf.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gcja5/test.esp32-idf.yaml b/tests/components/gcja5/test.esp32-idf.yaml index bc0f89eb9e..811f6b72a6 100644 --- a/tests/components/gcja5/test.esp32-idf.yaml +++ b/tests/components/gcja5/test.esp32-idf.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 17 - rx_pin: 16 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gcja5/test.esp8266-ard.yaml b/tests/components/gcja5/test.esp8266-ard.yaml index ec8765be52..b516342f3b 100644 --- a/tests/components/gcja5/test.esp8266-ard.yaml +++ b/tests/components/gcja5/test.esp8266-ard.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gcja5/test.rp2040-ard.yaml b/tests/components/gcja5/test.rp2040-ard.yaml index ec8765be52..b516342f3b 100644 --- a/tests/components/gcja5/test.rp2040-ard.yaml +++ b/tests/components/gcja5/test.rp2040-ard.yaml @@ -1,25 +1,5 @@ -uart: - - id: uart_gcja5 - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: gcja5 - pm_1_0: - name: "Particulate Matter <1.0µm Concentration" - pm_2_5: - name: "Particulate Matter <2.5µm Concentration" - pm_10_0: - name: "Particulate Matter <10.0µm Concentration" - pmc_0_5: - name: "PMC 0.5" - pmc_1_0: - name: "PMC 1.0" - pmc_2_5: - name: "PMC 2.5" - pmc_5_0: - name: "PMC 5.0" - pmc_10_0: - name: "PMC 10.0" +<<: !include common.yaml diff --git a/tests/components/gdk101/common.yaml b/tests/components/gdk101/common.yaml index f886fc415b..7805ad43f0 100644 --- a/tests/components/gdk101/common.yaml +++ b/tests/components/gdk101/common.yaml @@ -1,11 +1,10 @@ i2c: - id: i2c_bus - sda: ${i2c_sda} - scl: ${i2c_scl} + - id: i2c_gdk101 + scl: ${scl_pin} + sda: ${sda_pin} gdk101: id: my_gdk101 - i2c_id: i2c_bus sensor: - platform: gdk101 diff --git a/tests/components/gdk101/test.esp32-ard.yaml b/tests/components/gdk101/test.esp32-ard.yaml index 1037d5d35b..63c3bd6afd 100644 --- a/tests/components/gdk101/test.esp32-ard.yaml +++ b/tests/components/gdk101/test.esp32-ard.yaml @@ -1,5 +1,5 @@ substitutions: - i2c_scl: GPIO16 - i2c_sda: GPIO17 + scl_pin: GPIO16 + sda_pin: GPIO17 <<: !include common.yaml diff --git a/tests/components/gdk101/test.esp32-idf.yaml b/tests/components/gdk101/test.esp32-idf.yaml index 1037d5d35b..63c3bd6afd 100644 --- a/tests/components/gdk101/test.esp32-idf.yaml +++ b/tests/components/gdk101/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - i2c_scl: GPIO16 - i2c_sda: GPIO17 + scl_pin: GPIO16 + sda_pin: GPIO17 <<: !include common.yaml diff --git a/tests/components/gdk101/test.esp8266-ard.yaml b/tests/components/gdk101/test.esp8266-ard.yaml index d7ae0d5161..ee2c29ca4e 100644 --- a/tests/components/gdk101/test.esp8266-ard.yaml +++ b/tests/components/gdk101/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - i2c_scl: GPIO5 - i2c_sda: GPIO4 + scl_pin: GPIO5 + sda_pin: GPIO4 <<: !include common.yaml diff --git a/tests/components/gdk101/test.rp2040-ard.yaml b/tests/components/gdk101/test.rp2040-ard.yaml index d7ae0d5161..ee2c29ca4e 100644 --- a/tests/components/gdk101/test.rp2040-ard.yaml +++ b/tests/components/gdk101/test.rp2040-ard.yaml @@ -1,5 +1,5 @@ substitutions: - i2c_scl: GPIO5 - i2c_sda: GPIO4 + scl_pin: GPIO5 + sda_pin: GPIO4 <<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/common.yaml b/tests/components/gp2y1010au0f/common.yaml new file mode 100644 index 0000000000..95112fa712 --- /dev/null +++ b/tests/components/gp2y1010au0f/common.yaml @@ -0,0 +1,15 @@ +sensor: + - platform: adc + id: adc_sensor + pin: ${adc_pin} + - platform: gp2y1010au0f + sensor: adc_sensor + name: Dust Sensor + adc_voltage_offset: 0.2 + adc_voltage_multiplier: 3.3 + output: dust_sensor_led + +output: + - platform: gpio + id: dust_sensor_led + pin: ${output_pin} diff --git a/tests/components/gp2y1010au0f/test.esp32-ard.yaml b/tests/components/gp2y1010au0f/test.esp32-ard.yaml new file mode 100644 index 0000000000..d9494a95b7 --- /dev/null +++ b/tests/components/gp2y1010au0f/test.esp32-ard.yaml @@ -0,0 +1,5 @@ +substitutions: + adc_pin: A0 + output_pin: GPIO14 + +<<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.esp32-c3-ard.yaml b/tests/components/gp2y1010au0f/test.esp32-c3-ard.yaml new file mode 100644 index 0000000000..0e331c893c --- /dev/null +++ b/tests/components/gp2y1010au0f/test.esp32-c3-ard.yaml @@ -0,0 +1,5 @@ +substitutions: + adc_pin: GPIO0 + output_pin: GPIO1 + +<<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.esp32-c3-idf.yaml b/tests/components/gp2y1010au0f/test.esp32-c3-idf.yaml new file mode 100644 index 0000000000..0e331c893c --- /dev/null +++ b/tests/components/gp2y1010au0f/test.esp32-c3-idf.yaml @@ -0,0 +1,5 @@ +substitutions: + adc_pin: GPIO0 + output_pin: GPIO1 + +<<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.esp32-idf.yaml b/tests/components/gp2y1010au0f/test.esp32-idf.yaml index eb5ad0ea67..d9494a95b7 100644 --- a/tests/components/gp2y1010au0f/test.esp32-idf.yaml +++ b/tests/components/gp2y1010au0f/test.esp32-idf.yaml @@ -1,16 +1,5 @@ -sensor: - - platform: adc - pin: GPIO36 - id: adc_sensor +substitutions: + adc_pin: A0 + output_pin: GPIO14 - - platform: gp2y1010au0f - sensor: adc_sensor - name: Dust Sensor - adc_voltage_offset: 0.2 - adc_voltage_multiplier: 3.3 - output: dust_sensor_led - -output: - - platform: gpio - id: dust_sensor_led - pin: GPIO32 +<<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.esp8266-ard.yaml b/tests/components/gp2y1010au0f/test.esp8266-ard.yaml new file mode 100644 index 0000000000..a61053426a --- /dev/null +++ b/tests/components/gp2y1010au0f/test.esp8266-ard.yaml @@ -0,0 +1,5 @@ +substitutions: + adc_pin: A0 + output_pin: GPIO5 + +<<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.rp2040-ard.yaml b/tests/components/gp2y1010au0f/test.rp2040-ard.yaml new file mode 100644 index 0000000000..e00f19941c --- /dev/null +++ b/tests/components/gp2y1010au0f/test.rp2040-ard.yaml @@ -0,0 +1,5 @@ +substitutions: + adc_pin: GPIO26 + output_pin: GPIO5 + +<<: !include common.yaml diff --git a/tests/components/gp8403/common.yaml b/tests/components/gp8403/common.yaml new file mode 100644 index 0000000000..7074185273 --- /dev/null +++ b/tests/components/gp8403/common.yaml @@ -0,0 +1,20 @@ +i2c: + - id: i2c_gp8403 + scl: ${scl_pin} + sda: ${sda_pin} + +gp8403: + - id: gp8403_5v + voltage: 5V + - id: gp8403_10v + voltage: 10V + +output: + - platform: gp8403 + id: gp8403_output_0 + gp8403_id: gp8403_5v + channel: 0 + - platform: gp8403 + gp8403_id: gp8403_10v + id: gp8403_output_1 + channel: 1 diff --git a/tests/components/gp8403/test.esp32-ard.yaml b/tests/components/gp8403/test.esp32-ard.yaml index 8470a303e1..63c3bd6afd 100644 --- a/tests/components/gp8403/test.esp32-ard.yaml +++ b/tests/components/gp8403/test.esp32-ard.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gp8403/test.esp32-c3-ard.yaml b/tests/components/gp8403/test.esp32-c3-ard.yaml index fbc40b948b..ee2c29ca4e 100644 --- a/tests/components/gp8403/test.esp32-c3-ard.yaml +++ b/tests/components/gp8403/test.esp32-c3-ard.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gp8403/test.esp32-c3-idf.yaml b/tests/components/gp8403/test.esp32-c3-idf.yaml index fbc40b948b..ee2c29ca4e 100644 --- a/tests/components/gp8403/test.esp32-c3-idf.yaml +++ b/tests/components/gp8403/test.esp32-c3-idf.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gp8403/test.esp32-idf.yaml b/tests/components/gp8403/test.esp32-idf.yaml index 8470a303e1..63c3bd6afd 100644 --- a/tests/components/gp8403/test.esp32-idf.yaml +++ b/tests/components/gp8403/test.esp32-idf.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gp8403/test.esp8266-ard.yaml b/tests/components/gp8403/test.esp8266-ard.yaml index fbc40b948b..ee2c29ca4e 100644 --- a/tests/components/gp8403/test.esp8266-ard.yaml +++ b/tests/components/gp8403/test.esp8266-ard.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gp8403/test.rp2040-ard.yaml b/tests/components/gp8403/test.rp2040-ard.yaml index fbc40b948b..ee2c29ca4e 100644 --- a/tests/components/gp8403/test.rp2040-ard.yaml +++ b/tests/components/gp8403/test.rp2040-ard.yaml @@ -1,20 +1,5 @@ -i2c: - - id: i2c_gp8403 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -gp8403: - - id: gp8403_5v - voltage: 5V - - id: gp8403_10v - voltage: 10V - -output: - - platform: gp8403 - id: gp8403_output_0 - gp8403_id: gp8403_5v - channel: 0 - - platform: gp8403 - gp8403_id: gp8403_10v - id: gp8403_output_1 - channel: 1 +<<: !include common.yaml diff --git a/tests/components/gpio/common.yaml b/tests/components/gpio/common.yaml new file mode 100644 index 0000000000..4e237349d9 --- /dev/null +++ b/tests/components/gpio/common.yaml @@ -0,0 +1,14 @@ +binary_sensor: + - platform: gpio + pin: ${binary_sensor_pin} + id: gpio_binary_sensor + +output: + - platform: gpio + pin: ${output_pin} + id: gpio_output + +switch: + - platform: gpio + pin: ${switch_pin} + id: gpio_switch diff --git a/tests/components/gpio/test.esp32-ard.yaml b/tests/components/gpio/test.esp32-ard.yaml index 30dfa94b68..09f41abb79 100644 --- a/tests/components/gpio/test.esp32-ard.yaml +++ b/tests/components/gpio/test.esp32-ard.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 12 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO12 + output_pin: GPIO13 + switch_pin: GPIO14 -output: - - platform: gpio - pin: 13 - id: gpio_output - -switch: - - platform: gpio - pin: 14 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gpio/test.esp32-c3-ard.yaml b/tests/components/gpio/test.esp32-c3-ard.yaml index 3ca285117d..fc7c9942d0 100644 --- a/tests/components/gpio/test.esp32-c3-ard.yaml +++ b/tests/components/gpio/test.esp32-c3-ard.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 2 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO2 + output_pin: GPIO3 + switch_pin: GPIO4 -output: - - platform: gpio - pin: 3 - id: gpio_output - -switch: - - platform: gpio - pin: 4 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gpio/test.esp32-c3-idf.yaml b/tests/components/gpio/test.esp32-c3-idf.yaml index 3ca285117d..fc7c9942d0 100644 --- a/tests/components/gpio/test.esp32-c3-idf.yaml +++ b/tests/components/gpio/test.esp32-c3-idf.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 2 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO2 + output_pin: GPIO3 + switch_pin: GPIO4 -output: - - platform: gpio - pin: 3 - id: gpio_output - -switch: - - platform: gpio - pin: 4 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gpio/test.esp32-idf.yaml b/tests/components/gpio/test.esp32-idf.yaml index 30dfa94b68..09f41abb79 100644 --- a/tests/components/gpio/test.esp32-idf.yaml +++ b/tests/components/gpio/test.esp32-idf.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 12 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO12 + output_pin: GPIO13 + switch_pin: GPIO14 -output: - - platform: gpio - pin: 13 - id: gpio_output - -switch: - - platform: gpio - pin: 14 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gpio/test.esp8266-ard.yaml b/tests/components/gpio/test.esp8266-ard.yaml index 30dfa94b68..09f41abb79 100644 --- a/tests/components/gpio/test.esp8266-ard.yaml +++ b/tests/components/gpio/test.esp8266-ard.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 12 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO12 + output_pin: GPIO13 + switch_pin: GPIO14 -output: - - platform: gpio - pin: 13 - id: gpio_output - -switch: - - platform: gpio - pin: 14 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gpio/test.rp2040-ard.yaml b/tests/components/gpio/test.rp2040-ard.yaml index 3ca285117d..fc7c9942d0 100644 --- a/tests/components/gpio/test.rp2040-ard.yaml +++ b/tests/components/gpio/test.rp2040-ard.yaml @@ -1,14 +1,6 @@ -binary_sensor: - - platform: gpio - pin: 2 - id: gpio_binary_sensor +substitutions: + binary_sensor_pin: GPIO2 + output_pin: GPIO3 + switch_pin: GPIO4 -output: - - platform: gpio - pin: 3 - id: gpio_output - -switch: - - platform: gpio - pin: 4 - id: gpio_switch +<<: !include common.yaml diff --git a/tests/components/gps/common.yaml b/tests/components/gps/common.yaml new file mode 100644 index 0000000000..fc8228c909 --- /dev/null +++ b/tests/components/gps/common.yaml @@ -0,0 +1,14 @@ +uart: + - id: uart_gps + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN + +gps: + +time: + - platform: gps + on_time_sync: + then: + logger.log: "It's time!" diff --git a/tests/components/gps/test.esp32-ard.yaml b/tests/components/gps/test.esp32-ard.yaml index c4e4cf9f6f..811f6b72a6 100644 --- a/tests/components/gps/test.esp32-ard.yaml +++ b/tests/components/gps/test.esp32-ard.yaml @@ -1,14 +1,5 @@ -uart: - - id: uart_gps - tx_pin: 17 - rx_pin: 16 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -gps: - -time: - - platform: gps - on_time_sync: - then: - logger.log: "It's time!" +<<: !include common.yaml diff --git a/tests/components/gps/test.esp32-c3-ard.yaml b/tests/components/gps/test.esp32-c3-ard.yaml index 031f45b873..b516342f3b 100644 --- a/tests/components/gps/test.esp32-c3-ard.yaml +++ b/tests/components/gps/test.esp32-c3-ard.yaml @@ -1,14 +1,5 @@ -uart: - - id: uart_gps - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -gps: - -time: - - platform: gps - on_time_sync: - then: - logger.log: "It's time!" +<<: !include common.yaml diff --git a/tests/components/gps/test.esp8266-ard.yaml b/tests/components/gps/test.esp8266-ard.yaml index 031f45b873..b516342f3b 100644 --- a/tests/components/gps/test.esp8266-ard.yaml +++ b/tests/components/gps/test.esp8266-ard.yaml @@ -1,14 +1,5 @@ -uart: - - id: uart_gps - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -gps: - -time: - - platform: gps - on_time_sync: - then: - logger.log: "It's time!" +<<: !include common.yaml diff --git a/tests/components/gps/test.rp2040-ard.yaml b/tests/components/gps/test.rp2040-ard.yaml index 031f45b873..b516342f3b 100644 --- a/tests/components/gps/test.rp2040-ard.yaml +++ b/tests/components/gps/test.rp2040-ard.yaml @@ -1,14 +1,5 @@ -uart: - - id: uart_gps - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -gps: - -time: - - platform: gps - on_time_sync: - then: - logger.log: "It's time!" +<<: !include common.yaml diff --git a/tests/components/graph/common.yaml b/tests/components/graph/common.yaml new file mode 100644 index 0000000000..d2a6a9422d --- /dev/null +++ b/tests/components/graph/common.yaml @@ -0,0 +1,25 @@ +i2c: + - id: i2c_graph + scl: ${scl_pin} + sda: ${sda_pin} + +sensor: + - platform: template + id: some_sensor + +graph: + - id: some_graph + sensor: some_sensor + duration: 1h + width: 100 + height: 100 + +display: + - platform: ssd1306_i2c + id: ssd1306_display + model: SSD1306_128X64 + reset_pin: ${reset_pin} + pages: + - id: page1 + lambda: |- + it.rectangle(0, 0, it.get_width(), it.get_height()); diff --git a/tests/components/graph/test.esp32-ard.yaml b/tests/components/graph/test.esp32-ard.yaml index 8c0c0d4c9e..1ca773e06c 100644 --- a/tests/components/graph/test.esp32-ard.yaml +++ b/tests/components/graph/test.esp32-ard.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graph/test.esp32-c3-ard.yaml b/tests/components/graph/test.esp32-c3-ard.yaml index 8ce40e84ac..1e6670c196 100644 --- a/tests/components/graph/test.esp32-c3-ard.yaml +++ b/tests/components/graph/test.esp32-c3-ard.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graph/test.esp32-c3-idf.yaml b/tests/components/graph/test.esp32-c3-idf.yaml index 8ce40e84ac..1e6670c196 100644 --- a/tests/components/graph/test.esp32-c3-idf.yaml +++ b/tests/components/graph/test.esp32-c3-idf.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graph/test.esp32-idf.yaml b/tests/components/graph/test.esp32-idf.yaml index 8c0c0d4c9e..1ca773e06c 100644 --- a/tests/components/graph/test.esp32-idf.yaml +++ b/tests/components/graph/test.esp32-idf.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graph/test.esp8266-ard.yaml b/tests/components/graph/test.esp8266-ard.yaml index 33318355d5..dfdc12a3d1 100644 --- a/tests/components/graph/test.esp8266-ard.yaml +++ b/tests/components/graph/test.esp8266-ard.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO15 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graph/test.rp2040-ard.yaml b/tests/components/graph/test.rp2040-ard.yaml index 8ce40e84ac..1e6670c196 100644 --- a/tests/components/graph/test.rp2040-ard.yaml +++ b/tests/components/graph/test.rp2040-ard.yaml @@ -1,25 +1,6 @@ -i2c: - - id: i2c_graph - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -sensor: - - platform: template - id: some_sensor - -graph: - - id: some_graph - sensor: some_sensor - duration: 1h - width: 100 - height: 100 - -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/common.yaml b/tests/components/graphical_display_menu/common.yaml new file mode 100644 index 0000000000..d979a6a30e --- /dev/null +++ b/tests/components/graphical_display_menu/common.yaml @@ -0,0 +1,120 @@ +i2c: + - id: i2c_graphical_display_menu + scl: ${scl_pin} + sda: ${sda_pin} + +display: + - platform: ssd1306_i2c + id: ssd1306_display + model: SSD1306_128X64 + reset_pin: ${reset_pin} + pages: + - id: page1 + lambda: |- + it.rectangle(0, 0, it.get_width(), it.get_height()); + +font: + - file: "gfonts://Roboto" + id: roboto + size: 20 + +number: + - platform: template + id: test_number + min_value: 0 + step: 1 + max_value: 10 + optimistic: true + +select: + - platform: template + id: test_select + options: + - one + - two + optimistic: true + +switch: + - platform: template + id: test_switch + optimistic: true + +graphical_display_menu: + id: test_graphical_display_menu + display: ssd1306_display + font: roboto + active: false + mode: rotary + on_enter: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' + on_leave: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' + items: + - type: back + text: "Back" + - type: label + - type: menu + text: "Submenu 1" + items: + - type: back + text: "Back" + - type: menu + text: "Submenu 21" + items: + - type: back + text: "Back" + - type: command + text: "Show Main" + on_value: + then: + - display_menu.show_main: test_graphical_display_menu + - type: select + text: "Enum Item" + immediate_edit: true + select: test_select + on_enter: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + on_leave: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + on_value: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + - type: number + text: "Number" + number: test_number + on_enter: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + on_leave: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + on_value: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' + - type: command + text: "Hide" + on_value: + then: + - display_menu.hide: test_graphical_display_menu + - type: switch + text: "Switch" + switch: test_switch + on_text: "Bright" + off_text: "Dark" + immediate_edit: false + on_value: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' + - type: custom + text: !lambda 'return "Custom";' + value_lambda: 'return "Val";' + on_next: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' + on_prev: + then: + lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' diff --git a/tests/components/graphical_display_menu/test.esp32-ard.yaml b/tests/components/graphical_display_menu/test.esp32-ard.yaml index a0897536d7..1ca773e06c 100644 --- a/tests/components/graphical_display_menu/test.esp32-ard.yaml +++ b/tests/components/graphical_display_menu/test.esp32-ard.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp32-c3-ard.yaml b/tests/components/graphical_display_menu/test.esp32-c3-ard.yaml index 23acd4e4d9..1e6670c196 100644 --- a/tests/components/graphical_display_menu/test.esp32-c3-ard.yaml +++ b/tests/components/graphical_display_menu/test.esp32-c3-ard.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml b/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml index 23acd4e4d9..1e6670c196 100644 --- a/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml +++ b/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp32-idf.yaml b/tests/components/graphical_display_menu/test.esp32-idf.yaml index a0897536d7..1ca773e06c 100644 --- a/tests/components/graphical_display_menu/test.esp32-idf.yaml +++ b/tests/components/graphical_display_menu/test.esp32-idf.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp8266-ard.yaml b/tests/components/graphical_display_menu/test.esp8266-ard.yaml index 28c1a7298d..dfdc12a3d1 100644 --- a/tests/components/graphical_display_menu/test.esp8266-ard.yaml +++ b/tests/components/graphical_display_menu/test.esp8266-ard.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO15 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.rp2040-ard.yaml b/tests/components/graphical_display_menu/test.rp2040-ard.yaml index 23acd4e4d9..1e6670c196 100644 --- a/tests/components/graphical_display_menu/test.rp2040-ard.yaml +++ b/tests/components/graphical_display_menu/test.rp2040-ard.yaml @@ -1,120 +1,6 @@ -i2c: - - id: i2c_graphical_display_menu - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 3 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); - -font: - - file: "gfonts://Roboto" - id: roboto - size: 20 - -number: - - platform: template - id: test_number - min_value: 0 - step: 1 - max_value: 10 - optimistic: true - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - -switch: - - platform: template - id: test_switch - optimistic: true - -graphical_display_menu: - id: test_graphical_display_menu - display: ssd1306_display - font: roboto - active: false - mode: rotary - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root enter");' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "root leave");' - items: - - type: back - text: "Back" - - type: label - - type: menu - text: "Submenu 1" - items: - - type: back - text: "Back" - - type: menu - text: "Submenu 21" - items: - - type: back - text: "Back" - - type: command - text: "Show Main" - on_value: - then: - - display_menu.show_main: test_graphical_display_menu - - type: select - text: "Enum Item" - immediate_edit: true - select: test_select - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: number - text: "Number" - number: test_number - on_enter: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_leave: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' - - type: command - text: "Hide" - on_value: - then: - - display_menu.hide: test_graphical_display_menu - - type: switch - text: "Switch" - switch: test_switch - on_text: "Bright" - off_text: "Dark" - immediate_edit: false - on_value: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());' - - type: custom - text: !lambda 'return "Custom";' - value_lambda: 'return "Val";' - on_next: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());' - on_prev: - then: - lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());' +<<: !include common.yaml diff --git a/tests/components/gree/common.yaml b/tests/components/gree/common.yaml new file mode 100644 index 0000000000..c221184bbf --- /dev/null +++ b/tests/components/gree/common.yaml @@ -0,0 +1,8 @@ +remote_transmitter: + pin: ${pin} + carrier_duty_percent: 50% + +climate: + - platform: gree + name: GREE + model: generic diff --git a/tests/components/gree/test.esp32-ard.yaml b/tests/components/gree/test.esp32-ard.yaml index 91491d7e16..7b012aa64c 100644 --- a/tests/components/gree/test.esp32-ard.yaml +++ b/tests/components/gree/test.esp32-ard.yaml @@ -1,8 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: gree - name: GREE - model: generic +<<: !include common.yaml diff --git a/tests/components/gree/test.esp32-c3-ard.yaml b/tests/components/gree/test.esp32-c3-ard.yaml index 91491d7e16..7b012aa64c 100644 --- a/tests/components/gree/test.esp32-c3-ard.yaml +++ b/tests/components/gree/test.esp32-c3-ard.yaml @@ -1,8 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: gree - name: GREE - model: generic +<<: !include common.yaml diff --git a/tests/components/gree/test.esp32-c3-idf.yaml b/tests/components/gree/test.esp32-c3-idf.yaml index 91491d7e16..7b012aa64c 100644 --- a/tests/components/gree/test.esp32-c3-idf.yaml +++ b/tests/components/gree/test.esp32-c3-idf.yaml @@ -1,8 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: gree - name: GREE - model: generic +<<: !include common.yaml diff --git a/tests/components/gree/test.esp32-idf.yaml b/tests/components/gree/test.esp32-idf.yaml index 91491d7e16..7b012aa64c 100644 --- a/tests/components/gree/test.esp32-idf.yaml +++ b/tests/components/gree/test.esp32-idf.yaml @@ -1,8 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: gree - name: GREE - model: generic +<<: !include common.yaml diff --git a/tests/components/gree/test.esp8266-ard.yaml b/tests/components/gree/test.esp8266-ard.yaml index d0542973ce..f5097fcf5f 100644 --- a/tests/components/gree/test.esp8266-ard.yaml +++ b/tests/components/gree/test.esp8266-ard.yaml @@ -1,8 +1,4 @@ -remote_transmitter: - pin: 5 - carrier_duty_percent: 50% +substitutions: + pin: GPIO5 -climate: - - platform: gree - name: GREE - model: generic +<<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/common.yaml b/tests/components/grove_gas_mc_v2/common.yaml index 0729e6b9c7..dbdb950033 100644 --- a/tests/components/grove_gas_mc_v2/common.yaml +++ b/tests/components/grove_gas_mc_v2/common.yaml @@ -1,6 +1,10 @@ +i2c: + - id: i2c_grove_gas_mc_v2 + scl: ${scl_pin} + sda: ${sda_pin} + sensor: - platform: grove_gas_mc_v2 - i2c_id: i2c_bus nitrogen_dioxide: name: "Nitrogen Dioxide" ethanol: diff --git a/tests/components/grove_gas_mc_v2/test.esp32-ard.yaml b/tests/components/grove_gas_mc_v2/test.esp32-ard.yaml index 00c7856c36..63c3bd6afd 100644 --- a/tests/components/grove_gas_mc_v2/test.esp32-ard.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp32-ard.yaml @@ -1,6 +1,5 @@ -i2c: - sda: 21 - scl: 22 - id: i2c_bus +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp32-c3-ard.yaml b/tests/components/grove_gas_mc_v2/test.esp32-c3-ard.yaml new file mode 100644 index 0000000000..ee2c29ca4e --- /dev/null +++ b/tests/components/grove_gas_mc_v2/test.esp32-c3-ard.yaml @@ -0,0 +1,5 @@ +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +<<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml b/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml new file mode 100644 index 0000000000..ee2c29ca4e --- /dev/null +++ b/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml @@ -0,0 +1,5 @@ +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +<<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml b/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml index 00c7856c36..63c3bd6afd 100644 --- a/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml @@ -1,6 +1,5 @@ -i2c: - sda: 21 - scl: 22 - id: i2c_bus +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml b/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml index 2de18bdf39..ee2c29ca4e 100644 --- a/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml @@ -1,6 +1,5 @@ -i2c: - sda: 4 - scl: 5 - id: i2c_bus +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml b/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml index 00c7856c36..ee2c29ca4e 100644 --- a/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml +++ b/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml @@ -1,6 +1,5 @@ -i2c: - sda: 21 - scl: 22 - id: i2c_bus +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 <<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/common.yaml b/tests/components/grove_tb6612fng/common.yaml new file mode 100644 index 0000000000..0db6c00bf7 --- /dev/null +++ b/tests/components/grove_tb6612fng/common.yaml @@ -0,0 +1,23 @@ +esphome: + on_boot: + then: + - grove_tb6612fng.run: + channel: 1 + speed: 255 + direction: BACKWARD + id: test_motor + - grove_tb6612fng.stop: + channel: 1 + id: test_motor + - grove_tb6612fng.break: + channel: 1 + id: test_motor + +i2c: + - id: i2c_grove_tb6612fng + scl: ${scl_pin} + sda: ${sda_pin} + +grove_tb6612fng: + id: test_motor + address: 0x14 diff --git a/tests/components/grove_tb6612fng/test.esp32-ard.yaml b/tests/components/grove_tb6612fng/test.esp32-ard.yaml index 3271fb754f..63c3bd6afd 100644 --- a/tests/components/grove_tb6612fng/test.esp32-ard.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-ard.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -i2c: - - id: i2c_grove_tb6612fng - scl: 16 - sda: 17 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp32-c3-ard.yaml b/tests/components/grove_tb6612fng/test.esp32-c3-ard.yaml index ef6dff6539..ee2c29ca4e 100644 --- a/tests/components/grove_tb6612fng/test.esp32-c3-ard.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-c3-ard.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -i2c: - - id: i2c_grove_tb6612fng - scl: 5 - sda: 4 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml b/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml index ef6dff6539..ee2c29ca4e 100644 --- a/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -i2c: - - id: i2c_grove_tb6612fng - scl: 5 - sda: 4 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp32-idf.yaml b/tests/components/grove_tb6612fng/test.esp32-idf.yaml index 3271fb754f..63c3bd6afd 100644 --- a/tests/components/grove_tb6612fng/test.esp32-idf.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-idf.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -i2c: - - id: i2c_grove_tb6612fng - scl: 16 - sda: 17 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp8266-ard.yaml b/tests/components/grove_tb6612fng/test.esp8266-ard.yaml index ef6dff6539..ee2c29ca4e 100644 --- a/tests/components/grove_tb6612fng/test.esp8266-ard.yaml +++ b/tests/components/grove_tb6612fng/test.esp8266-ard.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -i2c: - - id: i2c_grove_tb6612fng - scl: 5 - sda: 4 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.rp2040-ard.yaml b/tests/components/grove_tb6612fng/test.rp2040-ard.yaml index ef6dff6539..ee2c29ca4e 100644 --- a/tests/components/grove_tb6612fng/test.rp2040-ard.yaml +++ b/tests/components/grove_tb6612fng/test.rp2040-ard.yaml @@ -1,23 +1,5 @@ -esphome: - on_boot: - then: - - grove_tb6612fng.run: - channel: 1 - speed: 255 - direction: BACKWARD - id: test_motor - - grove_tb6612fng.stop: - channel: 1 - id: test_motor - - grove_tb6612fng.break: - channel: 1 - id: test_motor +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -i2c: - - id: i2c_grove_tb6612fng - scl: 5 - sda: 4 - -grove_tb6612fng: - id: test_motor - address: 0x14 +<<: !include common.yaml diff --git a/tests/components/growatt_solar/common.yaml b/tests/components/growatt_solar/common.yaml new file mode 100644 index 0000000000..7cc6b2a139 --- /dev/null +++ b/tests/components/growatt_solar/common.yaml @@ -0,0 +1,62 @@ +uart: + - id: uart_growatt_solar + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + +modbus: + flow_control_pin: ${flow_control_pin} + +sensor: + - platform: growatt_solar + update_interval: 10s + protocol_version: RTU + inverter_status: + name: Growatt Status Code + phase_a: + voltage: + name: Growatt Voltage Phase A + current: + name: Growatt Current Phase A + active_power: + name: Growatt Power Phase A + phase_b: + voltage: + name: Growatt Voltage Phase B + current: + name: Growatt Current Phase B + active_power: + name: Growatt Power Phase B + phase_c: + voltage: + name: Growatt Voltage Phase C + current: + name: Growatt Current Phase C + active_power: + name: Growatt Power Phase C + pv1: + voltage: + name: Growatt PV1 Voltage + current: + name: Growatt PV1 Current + active_power: + name: Growatt PV1 Active Power + pv2: + voltage: + name: Growatt PV2 Voltage + current: + name: Growatt PV2 Current + active_power: + name: Growatt PV2 Active Power + active_power: + name: Growatt Grid Active Power + pv_active_power: + name: Growatt PV Active Power + frequency: + name: Growatt Frequency + energy_production_day: + name: Growatt Today's Generation + total_energy_production: + name: Growatt Total Energy Production + inverter_module_temp: + name: Growatt Inverter Module Temp diff --git a/tests/components/growatt_solar/test.esp32-ard.yaml b/tests/components/growatt_solar/test.esp32-ard.yaml index 654f2ccedf..bd767a8ece 100644 --- a/tests/components/growatt_solar/test.esp32-ard.yaml +++ b/tests/components/growatt_solar/test.esp32-ard.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 17 - rx_pin: 16 - baud_rate: 9600 +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 + flow_control_pin: GPIO13 -modbus: - flow_control_pin: 13 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp32-c3-ard.yaml b/tests/components/growatt_solar/test.esp32-c3-ard.yaml index 7e73897856..452031a5aa 100644 --- a/tests/components/growatt_solar/test.esp32-c3-ard.yaml +++ b/tests/components/growatt_solar/test.esp32-c3-ard.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO3 -modbus: - flow_control_pin: 3 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp32-c3-idf.yaml b/tests/components/growatt_solar/test.esp32-c3-idf.yaml index 7e73897856..452031a5aa 100644 --- a/tests/components/growatt_solar/test.esp32-c3-idf.yaml +++ b/tests/components/growatt_solar/test.esp32-c3-idf.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO3 -modbus: - flow_control_pin: 3 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp32-idf.yaml b/tests/components/growatt_solar/test.esp32-idf.yaml index 654f2ccedf..bd767a8ece 100644 --- a/tests/components/growatt_solar/test.esp32-idf.yaml +++ b/tests/components/growatt_solar/test.esp32-idf.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 17 - rx_pin: 16 - baud_rate: 9600 +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 + flow_control_pin: GPIO13 -modbus: - flow_control_pin: 13 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp8266-ard.yaml b/tests/components/growatt_solar/test.esp8266-ard.yaml index a1cf8267ae..29c98d0957 100644 --- a/tests/components/growatt_solar/test.esp8266-ard.yaml +++ b/tests/components/growatt_solar/test.esp8266-ard.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO13 -modbus: - flow_control_pin: 13 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml diff --git a/tests/components/growatt_solar/test.rp2040-ard.yaml b/tests/components/growatt_solar/test.rp2040-ard.yaml index 7e73897856..452031a5aa 100644 --- a/tests/components/growatt_solar/test.rp2040-ard.yaml +++ b/tests/components/growatt_solar/test.rp2040-ard.yaml @@ -1,62 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO3 -modbus: - flow_control_pin: 3 - -sensor: - - platform: growatt_solar - update_interval: 10s - protocol_version: RTU - inverter_status: - name: Growatt Status Code - phase_a: - voltage: - name: Growatt Voltage Phase A - current: - name: Growatt Current Phase A - active_power: - name: Growatt Power Phase A - phase_b: - voltage: - name: Growatt Voltage Phase B - current: - name: Growatt Current Phase B - active_power: - name: Growatt Power Phase B - phase_c: - voltage: - name: Growatt Voltage Phase C - current: - name: Growatt Current Phase C - active_power: - name: Growatt Power Phase C - pv1: - voltage: - name: Growatt PV1 Voltage - current: - name: Growatt PV1 Current - active_power: - name: Growatt PV1 Active Power - pv2: - voltage: - name: Growatt PV2 Voltage - current: - name: Growatt PV2 Current - active_power: - name: Growatt PV2 Active Power - active_power: - name: Growatt Grid Active Power - pv_active_power: - name: Growatt PV Active Power - frequency: - name: Growatt Frequency - energy_production_day: - name: Growatt Today's Generation - total_energy_production: - name: Growatt Total Energy Production - inverter_module_temp: - name: Growatt Inverter Module Temp +<<: !include common.yaml