From 61ad2510fc045f05034975c42516868acb9de5a8 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Tue, 4 Feb 2025 17:05:08 -0600 Subject: [PATCH] [CI] Consolidate some tests (C) (#8186) --- tests/components/cap1188/common.yaml | 11 +++ tests/components/cap1188/test.esp32-ard.yaml | 15 ++-- .../components/cap1188/test.esp32-c3-ard.yaml | 15 ++-- .../components/cap1188/test.esp32-c3-idf.yaml | 15 ++-- tests/components/cap1188/test.esp32-idf.yaml | 15 ++-- .../components/cap1188/test.esp8266-ard.yaml | 15 ++-- tests/components/cap1188/test.rp2040-ard.yaml | 15 ++-- tests/components/ccs811/common.yaml | 13 ++++ tests/components/ccs811/test.esp32-ard.yaml | 16 ++--- .../components/ccs811/test.esp32-c3-ard.yaml | 16 ++--- .../components/ccs811/test.esp32-c3-idf.yaml | 16 ++--- tests/components/ccs811/test.esp32-idf.yaml | 16 ++--- tests/components/ccs811/test.esp8266-ard.yaml | 16 ++--- tests/components/ccs811/test.rp2040-ard.yaml | 16 ++--- tests/components/cd74hc4067/common.yaml | 18 +++++ .../components/cd74hc4067/test.esp32-ard.yaml | 24 ++----- .../cd74hc4067/test.esp32-c3-ard.yaml | 24 ++----- .../cd74hc4067/test.esp32-c3-idf.yaml | 24 ++----- .../components/cd74hc4067/test.esp32-idf.yaml | 24 ++----- .../cd74hc4067/test.esp8266-ard.yaml | 24 ++----- .../cd74hc4067/test.rp2040-ard.yaml | 24 ++----- tests/components/climate_ir_lg/common.yaml | 7 ++ .../climate_ir_lg/test.esp32-ard.yaml | 9 +-- .../climate_ir_lg/test.esp32-c3-ard.yaml | 9 +-- .../climate_ir_lg/test.esp32-c3-idf.yaml | 9 +-- .../climate_ir_lg/test.esp32-idf.yaml | 9 +-- .../climate_ir_lg/test.esp8266-ard.yaml | 9 +-- .../components/color_temperature/common.yaml | 15 ++++ .../color_temperature/test.esp32-ard.yaml | 19 ++--- .../color_temperature/test.esp32-c3-ard.yaml | 19 ++--- .../color_temperature/test.esp32-c3-idf.yaml | 19 ++--- .../color_temperature/test.esp32-idf.yaml | 19 ++--- .../color_temperature/test.esp8266-ard.yaml | 19 ++--- .../color_temperature/test.rp2040-ard.yaml | 19 ++--- tests/components/coolix/common.yaml | 7 ++ tests/components/coolix/test.esp32-ard.yaml | 9 +-- .../components/coolix/test.esp32-c3-ard.yaml | 9 +-- .../components/coolix/test.esp32-c3-idf.yaml | 9 +-- tests/components/coolix/test.esp32-idf.yaml | 9 +-- tests/components/coolix/test.esp8266-ard.yaml | 9 +-- tests/components/copy/common.yaml | 23 ++++++ tests/components/copy/test.esp32-ard.yaml | 26 ++----- tests/components/copy/test.esp32-c3-ard.yaml | 26 ++----- tests/components/copy/test.esp32-c3-idf.yaml | 26 ++----- tests/components/copy/test.esp32-idf.yaml | 26 ++----- tests/components/copy/test.esp8266-ard.yaml | 26 ++----- tests/components/copy/test.rp2040-ard.yaml | 26 ++----- tests/components/cs5460a/common.yaml | 27 +++++++ tests/components/cs5460a/test.esp32-ard.yaml | 32 ++------- .../components/cs5460a/test.esp32-c3-ard.yaml | 32 ++------- .../components/cs5460a/test.esp32-c3-idf.yaml | 32 ++------- tests/components/cs5460a/test.esp32-idf.yaml | 32 ++------- .../components/cs5460a/test.esp8266-ard.yaml | 32 ++------- tests/components/cs5460a/test.rp2040-ard.yaml | 32 ++------- tests/components/cse7761/common.yaml | 18 +++++ tests/components/cse7761/test.esp32-ard.yaml | 23 ++---- .../components/cse7761/test.esp32-c3-ard.yaml | 23 ++---- .../components/cse7761/test.esp32-c3-idf.yaml | 23 ++---- tests/components/cse7761/test.esp32-idf.yaml | 23 ++---- .../components/cse7761/test.esp8266-ard.yaml | 23 ++---- tests/components/cse7761/test.rp2040-ard.yaml | 23 ++---- tests/components/cse7766/common.yaml | 15 ++++ tests/components/cse7766/test.esp32-ard.yaml | 20 ++---- .../components/cse7766/test.esp32-c3-ard.yaml | 20 ++---- .../components/cse7766/test.esp32-c3-idf.yaml | 20 ++---- tests/components/cse7766/test.esp32-idf.yaml | 20 ++---- .../components/cse7766/test.esp8266-ard.yaml | 20 ++---- tests/components/cse7766/test.rp2040-ard.yaml | 20 ++---- tests/components/cst226/common.yaml | 34 ++++----- tests/components/cst226/test.esp32-ard.yaml | 12 ++++ .../components/cst226/test.esp32-c3-ard.yaml | 11 +++ .../components/cst226/test.esp32-c3-idf.yaml | 12 ++++ tests/components/cst226/test.esp32-idf.yaml | 12 ++++ tests/components/cst816/common.yaml | 41 +++++------ tests/components/cst816/test.esp32-ard.yaml | 11 +++ .../components/cst816/test.esp32-c3-ard.yaml | 12 ++++ .../components/cst816/test.esp32-c3-idf.yaml | 12 ++++ tests/components/cst816/test.esp32-idf.yaml | 12 ++++ tests/components/ct_clamp/common.yaml | 9 +++ tests/components/ct_clamp/test.esp32-ard.yaml | 13 ++-- .../ct_clamp/test.esp32-c3-ard.yaml | 13 ++-- .../ct_clamp/test.esp32-c3-idf.yaml | 13 ++-- tests/components/ct_clamp/test.esp32-idf.yaml | 13 ++-- .../components/ct_clamp/test.esp8266-ard.yaml | 13 ++-- .../components/ct_clamp/test.rp2040-ard.yaml | 13 ++-- tests/components/current_based/common.yaml | 68 ++++++++++++++++++ .../current_based/test.esp32-ard.yaml | 72 ++----------------- .../current_based/test.esp32-c3-ard.yaml | 72 ++----------------- .../current_based/test.esp32-c3-idf.yaml | 72 ++----------------- .../current_based/test.esp32-idf.yaml | 72 ++----------------- .../current_based/test.esp8266-ard.yaml | 72 ++----------------- .../current_based/test.rp2040-ard.yaml | 72 ++----------------- tests/components/cwww/common.yaml | 16 +++++ tests/components/cwww/test.esp32-ard.yaml | 20 ++---- tests/components/cwww/test.esp32-c3-ard.yaml | 20 ++---- tests/components/cwww/test.esp32-c3-idf.yaml | 25 +++---- tests/components/cwww/test.esp32-idf.yaml | 25 +++---- tests/components/cwww/test.esp8266-ard.yaml | 20 ++---- tests/components/cwww/test.rp2040-ard.yaml | 20 ++---- 99 files changed, 737 insertions(+), 1459 deletions(-) create mode 100644 tests/components/cap1188/common.yaml create mode 100644 tests/components/ccs811/common.yaml create mode 100644 tests/components/cd74hc4067/common.yaml create mode 100644 tests/components/climate_ir_lg/common.yaml create mode 100644 tests/components/color_temperature/common.yaml create mode 100644 tests/components/coolix/common.yaml create mode 100644 tests/components/copy/common.yaml create mode 100644 tests/components/cs5460a/common.yaml create mode 100644 tests/components/cse7761/common.yaml create mode 100644 tests/components/cse7766/common.yaml create mode 100644 tests/components/cst226/test.esp32-ard.yaml create mode 100644 tests/components/cst226/test.esp32-c3-idf.yaml create mode 100644 tests/components/cst226/test.esp32-idf.yaml create mode 100644 tests/components/cst816/test.esp32-c3-ard.yaml create mode 100644 tests/components/cst816/test.esp32-c3-idf.yaml create mode 100644 tests/components/cst816/test.esp32-idf.yaml create mode 100644 tests/components/ct_clamp/common.yaml create mode 100644 tests/components/current_based/common.yaml create mode 100644 tests/components/cwww/common.yaml diff --git a/tests/components/cap1188/common.yaml b/tests/components/cap1188/common.yaml new file mode 100644 index 0000000000..e83bf5d5d2 --- /dev/null +++ b/tests/components/cap1188/common.yaml @@ -0,0 +1,11 @@ +i2c: + - id: i2c_cap1188 + scl: ${scl_pin} + sda: ${sda_pin} + +cap1188: + id: cap1188_component + address: 0x29 + reset_pin: ${reset_pin} + touch_threshold: 0x20 + allow_multiple_touches: true diff --git a/tests/components/cap1188/test.esp32-ard.yaml b/tests/components/cap1188/test.esp32-ard.yaml index efd1d60217..1ca773e06c 100644 --- a/tests/components/cap1188/test.esp32-ard.yaml +++ b/tests/components/cap1188/test.esp32-ard.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 15 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/cap1188/test.esp32-c3-ard.yaml b/tests/components/cap1188/test.esp32-c3-ard.yaml index c6d3c95942..1e6670c196 100644 --- a/tests/components/cap1188/test.esp32-c3-ard.yaml +++ b/tests/components/cap1188/test.esp32-c3-ard.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 6 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/cap1188/test.esp32-c3-idf.yaml b/tests/components/cap1188/test.esp32-c3-idf.yaml index c6d3c95942..1e6670c196 100644 --- a/tests/components/cap1188/test.esp32-c3-idf.yaml +++ b/tests/components/cap1188/test.esp32-c3-idf.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 6 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/cap1188/test.esp32-idf.yaml b/tests/components/cap1188/test.esp32-idf.yaml index efd1d60217..1ca773e06c 100644 --- a/tests/components/cap1188/test.esp32-idf.yaml +++ b/tests/components/cap1188/test.esp32-idf.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + reset_pin: GPIO15 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 15 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/cap1188/test.esp8266-ard.yaml b/tests/components/cap1188/test.esp8266-ard.yaml index 7573d45140..dfdc12a3d1 100644 --- a/tests/components/cap1188/test.esp8266-ard.yaml +++ b/tests/components/cap1188/test.esp8266-ard.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO15 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 15 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/cap1188/test.rp2040-ard.yaml b/tests/components/cap1188/test.rp2040-ard.yaml index c6d3c95942..1e6670c196 100644 --- a/tests/components/cap1188/test.rp2040-ard.yaml +++ b/tests/components/cap1188/test.rp2040-ard.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + reset_pin: GPIO6 -cap1188: - id: cap1188_component - address: 0x29 - reset_pin: 6 - touch_threshold: 0x20 - allow_multiple_touches: true +<<: !include common.yaml diff --git a/tests/components/ccs811/common.yaml b/tests/components/ccs811/common.yaml new file mode 100644 index 0000000000..a781996c66 --- /dev/null +++ b/tests/components/ccs811/common.yaml @@ -0,0 +1,13 @@ +i2c: + - id: i2c_ccs811 + scl: ${scl_pin} + sda: ${sda_pin} + +sensor: + - platform: ccs811 + eco2: + name: CCS811 eCO2 + tvoc: + name: CCS811 TVOC + baseline: 0x4242 + update_interval: 30s diff --git a/tests/components/ccs811/test.esp32-ard.yaml b/tests/components/ccs811/test.esp32-ard.yaml index 08b3a48cc7..63c3bd6afd 100644 --- a/tests/components/ccs811/test.esp32-ard.yaml +++ b/tests/components/ccs811/test.esp32-ard.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/ccs811/test.esp32-c3-ard.yaml b/tests/components/ccs811/test.esp32-c3-ard.yaml index 26ec7807e4..ee2c29ca4e 100644 --- a/tests/components/ccs811/test.esp32-c3-ard.yaml +++ b/tests/components/ccs811/test.esp32-c3-ard.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/ccs811/test.esp32-c3-idf.yaml b/tests/components/ccs811/test.esp32-c3-idf.yaml index 26ec7807e4..ee2c29ca4e 100644 --- a/tests/components/ccs811/test.esp32-c3-idf.yaml +++ b/tests/components/ccs811/test.esp32-c3-idf.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/ccs811/test.esp32-idf.yaml b/tests/components/ccs811/test.esp32-idf.yaml index 08b3a48cc7..63c3bd6afd 100644 --- a/tests/components/ccs811/test.esp32-idf.yaml +++ b/tests/components/ccs811/test.esp32-idf.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/ccs811/test.esp8266-ard.yaml b/tests/components/ccs811/test.esp8266-ard.yaml index 26ec7807e4..ee2c29ca4e 100644 --- a/tests/components/ccs811/test.esp8266-ard.yaml +++ b/tests/components/ccs811/test.esp8266-ard.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/ccs811/test.rp2040-ard.yaml b/tests/components/ccs811/test.rp2040-ard.yaml index 26ec7807e4..ee2c29ca4e 100644 --- a/tests/components/ccs811/test.rp2040-ard.yaml +++ b/tests/components/ccs811/test.rp2040-ard.yaml @@ -1,13 +1,5 @@ -i2c: - - id: i2c_ccs811 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 -sensor: - - platform: ccs811 - eco2: - name: CCS811 eCO2 - tvoc: - name: CCS811 TVOC - baseline: 0x4242 - update_interval: 30s +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/common.yaml b/tests/components/cd74hc4067/common.yaml new file mode 100644 index 0000000000..9afb39cd31 --- /dev/null +++ b/tests/components/cd74hc4067/common.yaml @@ -0,0 +1,18 @@ +cd74hc4067: + pin_s0: ${pin_s0} + pin_s1: ${pin_s1} + pin_s2: ${pin_s2} + pin_s3: ${pin_s3} + +sensor: + - platform: adc + id: esp_adc_sensor + pin: ${pin} + - platform: cd74hc4067 + id: cd74hc4067_adc_0 + number: 0 + sensor: esp_adc_sensor + - platform: cd74hc4067 + id: cd74hc4067_adc_1 + number: 1 + sensor: esp_adc_sensor diff --git a/tests/components/cd74hc4067/test.esp32-ard.yaml b/tests/components/cd74hc4067/test.esp32-ard.yaml index 71a1238ccc..c4dd280943 100644 --- a/tests/components/cd74hc4067/test.esp32-ard.yaml +++ b/tests/components/cd74hc4067/test.esp32-ard.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 12 - pin_s1: 13 - pin_s2: 14 - pin_s3: 15 +substitutions: + pin_s0: GPIO12 + pin_s1: GPIO13 + pin_s2: GPIO14 + pin_s3: GPIO15 + pin: GPIO39 -sensor: - - platform: adc - id: esp_adc_sensor - pin: 39 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/test.esp32-c3-ard.yaml b/tests/components/cd74hc4067/test.esp32-c3-ard.yaml index 5aa653d26c..5e8784c1fc 100644 --- a/tests/components/cd74hc4067/test.esp32-c3-ard.yaml +++ b/tests/components/cd74hc4067/test.esp32-c3-ard.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 2 - pin_s1: 3 - pin_s2: 4 - pin_s3: 5 +substitutions: + pin_s0: GPIO2 + pin_s1: GPIO3 + pin_s2: GPIO4 + pin_s3: GPIO5 + pin: GPIO0 -sensor: - - platform: adc - id: esp_adc_sensor - pin: 0 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/test.esp32-c3-idf.yaml b/tests/components/cd74hc4067/test.esp32-c3-idf.yaml index 5aa653d26c..5e8784c1fc 100644 --- a/tests/components/cd74hc4067/test.esp32-c3-idf.yaml +++ b/tests/components/cd74hc4067/test.esp32-c3-idf.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 2 - pin_s1: 3 - pin_s2: 4 - pin_s3: 5 +substitutions: + pin_s0: GPIO2 + pin_s1: GPIO3 + pin_s2: GPIO4 + pin_s3: GPIO5 + pin: GPIO0 -sensor: - - platform: adc - id: esp_adc_sensor - pin: 0 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/test.esp32-idf.yaml b/tests/components/cd74hc4067/test.esp32-idf.yaml index 71a1238ccc..c4dd280943 100644 --- a/tests/components/cd74hc4067/test.esp32-idf.yaml +++ b/tests/components/cd74hc4067/test.esp32-idf.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 12 - pin_s1: 13 - pin_s2: 14 - pin_s3: 15 +substitutions: + pin_s0: GPIO12 + pin_s1: GPIO13 + pin_s2: GPIO14 + pin_s3: GPIO15 + pin: GPIO39 -sensor: - - platform: adc - id: esp_adc_sensor - pin: 39 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/test.esp8266-ard.yaml b/tests/components/cd74hc4067/test.esp8266-ard.yaml index 8bcce5bc17..1162cec1f8 100644 --- a/tests/components/cd74hc4067/test.esp8266-ard.yaml +++ b/tests/components/cd74hc4067/test.esp8266-ard.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 12 - pin_s1: 13 - pin_s2: 14 - pin_s3: 15 +substitutions: + pin_s0: GPIO12 + pin_s1: GPIO13 + pin_s2: GPIO14 + pin_s3: GPIO15 + pin: A0 -sensor: - - platform: adc - id: esp_adc_sensor - pin: A0 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/cd74hc4067/test.rp2040-ard.yaml b/tests/components/cd74hc4067/test.rp2040-ard.yaml index 75adcce796..88c3273a44 100644 --- a/tests/components/cd74hc4067/test.rp2040-ard.yaml +++ b/tests/components/cd74hc4067/test.rp2040-ard.yaml @@ -1,18 +1,8 @@ -cd74hc4067: - pin_s0: 2 - pin_s1: 3 - pin_s2: 4 - pin_s3: 5 +substitutions: + pin_s0: GPIO2 + pin_s1: GPIO3 + pin_s2: GPIO4 + pin_s3: GPIO5 + pin: GPIO26 -sensor: - - platform: adc - id: esp_adc_sensor - pin: 26 - - platform: cd74hc4067 - id: cd74hc4067_adc_0 - number: 0 - sensor: esp_adc_sensor - - platform: cd74hc4067 - id: cd74hc4067_adc_1 - number: 1 - sensor: esp_adc_sensor +<<: !include common.yaml diff --git a/tests/components/climate_ir_lg/common.yaml b/tests/components/climate_ir_lg/common.yaml new file mode 100644 index 0000000000..c8f84411c0 --- /dev/null +++ b/tests/components/climate_ir_lg/common.yaml @@ -0,0 +1,7 @@ +remote_transmitter: + pin: ${pin} + carrier_duty_percent: 50% + +climate: + - platform: climate_ir_lg + name: LG Climate diff --git a/tests/components/climate_ir_lg/test.esp32-ard.yaml b/tests/components/climate_ir_lg/test.esp32-ard.yaml index e714bf0686..7b012aa64c 100644 --- a/tests/components/climate_ir_lg/test.esp32-ard.yaml +++ b/tests/components/climate_ir_lg/test.esp32-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: climate_ir_lg - name: LG Climate +<<: !include common.yaml diff --git a/tests/components/climate_ir_lg/test.esp32-c3-ard.yaml b/tests/components/climate_ir_lg/test.esp32-c3-ard.yaml index e714bf0686..7b012aa64c 100644 --- a/tests/components/climate_ir_lg/test.esp32-c3-ard.yaml +++ b/tests/components/climate_ir_lg/test.esp32-c3-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: climate_ir_lg - name: LG Climate +<<: !include common.yaml diff --git a/tests/components/climate_ir_lg/test.esp32-c3-idf.yaml b/tests/components/climate_ir_lg/test.esp32-c3-idf.yaml index e714bf0686..7b012aa64c 100644 --- a/tests/components/climate_ir_lg/test.esp32-c3-idf.yaml +++ b/tests/components/climate_ir_lg/test.esp32-c3-idf.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: climate_ir_lg - name: LG Climate +<<: !include common.yaml diff --git a/tests/components/climate_ir_lg/test.esp32-idf.yaml b/tests/components/climate_ir_lg/test.esp32-idf.yaml index e714bf0686..7b012aa64c 100644 --- a/tests/components/climate_ir_lg/test.esp32-idf.yaml +++ b/tests/components/climate_ir_lg/test.esp32-idf.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: climate_ir_lg - name: LG Climate +<<: !include common.yaml diff --git a/tests/components/climate_ir_lg/test.esp8266-ard.yaml b/tests/components/climate_ir_lg/test.esp8266-ard.yaml index 7482bf0580..f5097fcf5f 100644 --- a/tests/components/climate_ir_lg/test.esp8266-ard.yaml +++ b/tests/components/climate_ir_lg/test.esp8266-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 5 - carrier_duty_percent: 50% +substitutions: + pin: GPIO5 -climate: - - platform: climate_ir_lg - name: LG Climate +<<: !include common.yaml diff --git a/tests/components/color_temperature/common.yaml b/tests/components/color_temperature/common.yaml new file mode 100644 index 0000000000..fe0c5bf917 --- /dev/null +++ b/tests/components/color_temperature/common.yaml @@ -0,0 +1,15 @@ +output: + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} + +light: + - platform: color_temperature + name: Lights + color_temperature: light_output_1 + brightness: light_output_2 + cold_white_color_temperature: 153 mireds + warm_white_color_temperature: 500 mireds diff --git a/tests/components/color_temperature/test.esp32-ard.yaml b/tests/components/color_temperature/test.esp32-ard.yaml index 608907d2fc..1831adda6e 100644 --- a/tests/components/color_temperature/test.esp32-ard.yaml +++ b/tests/components/color_temperature/test.esp32-ard.yaml @@ -1,15 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 12 - - platform: ledc - id: light_output_2 - pin: 13 +substitutions: + light_platform: ledc + pin_o1: GPIO16 + pin_o2: GPIO17 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/color_temperature/test.esp32-c3-ard.yaml b/tests/components/color_temperature/test.esp32-c3-ard.yaml index 8d3faa54ee..016f315d9f 100644 --- a/tests/components/color_temperature/test.esp32-c3-ard.yaml +++ b/tests/components/color_temperature/test.esp32-c3-ard.yaml @@ -1,15 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 1 - - platform: ledc - id: light_output_2 - pin: 2 +substitutions: + light_platform: ledc + pin_o1: GPIO6 + pin_o2: GPIO7 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/color_temperature/test.esp32-c3-idf.yaml b/tests/components/color_temperature/test.esp32-c3-idf.yaml index 8d3faa54ee..016f315d9f 100644 --- a/tests/components/color_temperature/test.esp32-c3-idf.yaml +++ b/tests/components/color_temperature/test.esp32-c3-idf.yaml @@ -1,15 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 1 - - platform: ledc - id: light_output_2 - pin: 2 +substitutions: + light_platform: ledc + pin_o1: GPIO6 + pin_o2: GPIO7 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/color_temperature/test.esp32-idf.yaml b/tests/components/color_temperature/test.esp32-idf.yaml index 608907d2fc..1831adda6e 100644 --- a/tests/components/color_temperature/test.esp32-idf.yaml +++ b/tests/components/color_temperature/test.esp32-idf.yaml @@ -1,15 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 12 - - platform: ledc - id: light_output_2 - pin: 13 +substitutions: + light_platform: ledc + pin_o1: GPIO16 + pin_o2: GPIO17 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/color_temperature/test.esp8266-ard.yaml b/tests/components/color_temperature/test.esp8266-ard.yaml index ed0bfb6aa4..75a5b9d64d 100644 --- a/tests/components/color_temperature/test.esp8266-ard.yaml +++ b/tests/components/color_temperature/test.esp8266-ard.yaml @@ -1,15 +1,6 @@ -output: - - platform: esp8266_pwm - id: light_output_1 - pin: 12 - - platform: esp8266_pwm - id: light_output_2 - pin: 13 +substitutions: + light_platform: esp8266_pwm + pin_o1: GPIO12 + pin_o2: GPIO13 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/color_temperature/test.rp2040-ard.yaml b/tests/components/color_temperature/test.rp2040-ard.yaml index 887ad1c857..537177aca1 100644 --- a/tests/components/color_temperature/test.rp2040-ard.yaml +++ b/tests/components/color_temperature/test.rp2040-ard.yaml @@ -1,15 +1,6 @@ -output: - - platform: rp2040_pwm - id: light_output_1 - pin: 12 - - platform: rp2040_pwm - id: light_output_2 - pin: 13 +substitutions: + light_platform: rp2040_pwm + pin_o1: GPIO12 + pin_o2: GPIO13 -light: - - platform: color_temperature - name: Lights - color_temperature: light_output_1 - brightness: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds +<<: !include common.yaml diff --git a/tests/components/coolix/common.yaml b/tests/components/coolix/common.yaml new file mode 100644 index 0000000000..abe609c3ea --- /dev/null +++ b/tests/components/coolix/common.yaml @@ -0,0 +1,7 @@ +remote_transmitter: + pin: ${pin} + carrier_duty_percent: 50% + +climate: + - platform: coolix + name: Coolix Climate diff --git a/tests/components/coolix/test.esp32-ard.yaml b/tests/components/coolix/test.esp32-ard.yaml index 0f9518d2cf..7b012aa64c 100644 --- a/tests/components/coolix/test.esp32-ard.yaml +++ b/tests/components/coolix/test.esp32-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: coolix - name: Coolix Climate +<<: !include common.yaml diff --git a/tests/components/coolix/test.esp32-c3-ard.yaml b/tests/components/coolix/test.esp32-c3-ard.yaml index 0f9518d2cf..7b012aa64c 100644 --- a/tests/components/coolix/test.esp32-c3-ard.yaml +++ b/tests/components/coolix/test.esp32-c3-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: coolix - name: Coolix Climate +<<: !include common.yaml diff --git a/tests/components/coolix/test.esp32-c3-idf.yaml b/tests/components/coolix/test.esp32-c3-idf.yaml index 0f9518d2cf..7b012aa64c 100644 --- a/tests/components/coolix/test.esp32-c3-idf.yaml +++ b/tests/components/coolix/test.esp32-c3-idf.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: coolix - name: Coolix Climate +<<: !include common.yaml diff --git a/tests/components/coolix/test.esp32-idf.yaml b/tests/components/coolix/test.esp32-idf.yaml index 0f9518d2cf..7b012aa64c 100644 --- a/tests/components/coolix/test.esp32-idf.yaml +++ b/tests/components/coolix/test.esp32-idf.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 2 - carrier_duty_percent: 50% +substitutions: + pin: GPIO2 -climate: - - platform: coolix - name: Coolix Climate +<<: !include common.yaml diff --git a/tests/components/coolix/test.esp8266-ard.yaml b/tests/components/coolix/test.esp8266-ard.yaml index 61de8c7558..f5097fcf5f 100644 --- a/tests/components/coolix/test.esp8266-ard.yaml +++ b/tests/components/coolix/test.esp8266-ard.yaml @@ -1,7 +1,4 @@ -remote_transmitter: - pin: 5 - carrier_duty_percent: 50% +substitutions: + pin: GPIO5 -climate: - - platform: coolix - name: Coolix Climate +<<: !include common.yaml diff --git a/tests/components/copy/common.yaml b/tests/components/copy/common.yaml new file mode 100644 index 0000000000..a73b3467e6 --- /dev/null +++ b/tests/components/copy/common.yaml @@ -0,0 +1,23 @@ +output: + - platform: ${pwm_platform} + id: fan_output_1 + pin: ${pin} + +fan: + - platform: speed + id: fan_speed + output: fan_output_1 + - platform: copy + source_id: fan_speed + name: Fan Speed Copy + +select: + - platform: template + id: test_select + options: + - one + - two + optimistic: true + - platform: copy + source_id: test_select + name: Test Select Copy diff --git a/tests/components/copy/test.esp32-ard.yaml b/tests/components/copy/test.esp32-ard.yaml index 806dbfe9f3..e5337726dc 100644 --- a/tests/components/copy/test.esp32-ard.yaml +++ b/tests/components/copy/test.esp32-ard.yaml @@ -1,23 +1,5 @@ -output: - - platform: ledc - id: fan_output_1 - pin: 12 +substitutions: + pwm_platform: ledc + pin: GPIO12 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/copy/test.esp32-c3-ard.yaml b/tests/components/copy/test.esp32-c3-ard.yaml index 554638f462..76272beb77 100644 --- a/tests/components/copy/test.esp32-c3-ard.yaml +++ b/tests/components/copy/test.esp32-c3-ard.yaml @@ -1,23 +1,5 @@ -output: - - platform: ledc - id: fan_output_1 - pin: 2 +substitutions: + pwm_platform: ledc + pin: GPIO2 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/copy/test.esp32-c3-idf.yaml b/tests/components/copy/test.esp32-c3-idf.yaml index 554638f462..76272beb77 100644 --- a/tests/components/copy/test.esp32-c3-idf.yaml +++ b/tests/components/copy/test.esp32-c3-idf.yaml @@ -1,23 +1,5 @@ -output: - - platform: ledc - id: fan_output_1 - pin: 2 +substitutions: + pwm_platform: ledc + pin: GPIO2 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/copy/test.esp32-idf.yaml b/tests/components/copy/test.esp32-idf.yaml index 806dbfe9f3..e5337726dc 100644 --- a/tests/components/copy/test.esp32-idf.yaml +++ b/tests/components/copy/test.esp32-idf.yaml @@ -1,23 +1,5 @@ -output: - - platform: ledc - id: fan_output_1 - pin: 12 +substitutions: + pwm_platform: ledc + pin: GPIO12 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/copy/test.esp8266-ard.yaml b/tests/components/copy/test.esp8266-ard.yaml index 1521e5f279..497fac5161 100644 --- a/tests/components/copy/test.esp8266-ard.yaml +++ b/tests/components/copy/test.esp8266-ard.yaml @@ -1,23 +1,5 @@ -output: - - platform: esp8266_pwm - id: fan_output_1 - pin: 12 +substitutions: + pwm_platform: esp8266_pwm + pin: GPIO12 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/copy/test.rp2040-ard.yaml b/tests/components/copy/test.rp2040-ard.yaml index 42e5eb8000..61e461d247 100644 --- a/tests/components/copy/test.rp2040-ard.yaml +++ b/tests/components/copy/test.rp2040-ard.yaml @@ -1,23 +1,5 @@ -output: - - platform: rp2040_pwm - id: fan_output_1 - pin: 12 +substitutions: + pwm_platform: rp2040_pwm + pin: GPIO12 -fan: - - platform: speed - id: fan_speed - output: fan_output_1 - - platform: copy - source_id: fan_speed - name: Fan Speed Copy - -select: - - platform: template - id: test_select - options: - - one - - two - optimistic: true - - platform: copy - source_id: test_select - name: Test Select Copy +<<: !include common.yaml diff --git a/tests/components/cs5460a/common.yaml b/tests/components/cs5460a/common.yaml new file mode 100644 index 0000000000..d97b01716b --- /dev/null +++ b/tests/components/cs5460a/common.yaml @@ -0,0 +1,27 @@ +spi: + - id: spi_cs5460a + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} + +sensor: + - platform: cs5460a + id: cs5460a1 + cs_pin: ${cs_pin} + current: + name: Socket current + voltage: + name: Mains voltage + power: + name: Socket power + on_value: + then: + cs5460a.restart: cs5460a1 + samples: 1600 + pga_gain: 10X + current_gain: 0.01 + voltage_gain: 0.000573 + current_hpf: true + voltage_hpf: true + phase_offset: 20 + pulse_energy: 0.01 kWh diff --git a/tests/components/cs5460a/test.esp32-ard.yaml b/tests/components/cs5460a/test.esp32-ard.yaml index e7eb1cbd73..54e027a614 100644 --- a/tests/components/cs5460a/test.esp32-ard.yaml +++ b/tests/components/cs5460a/test.esp32-ard.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 16 - mosi_pin: 17 - miso_pin: 15 +substitutions: + clk_pin: GPIO16 + mosi_pin: GPIO17 + miso_pin: GPIO15 + cs_pin: GPIO5 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 12 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp32-c3-ard.yaml b/tests/components/cs5460a/test.esp32-c3-ard.yaml index 4ce21783a3..2415ba5dc6 100644 --- a/tests/components/cs5460a/test.esp32-c3-ard.yaml +++ b/tests/components/cs5460a/test.esp32-c3-ard.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 6 - mosi_pin: 7 - miso_pin: 5 +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + miso_pin: GPIO5 + cs_pin: GPIO8 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 8 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp32-c3-idf.yaml b/tests/components/cs5460a/test.esp32-c3-idf.yaml index 4ce21783a3..2415ba5dc6 100644 --- a/tests/components/cs5460a/test.esp32-c3-idf.yaml +++ b/tests/components/cs5460a/test.esp32-c3-idf.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 6 - mosi_pin: 7 - miso_pin: 5 +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + miso_pin: GPIO5 + cs_pin: GPIO8 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 8 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp32-idf.yaml b/tests/components/cs5460a/test.esp32-idf.yaml index e7eb1cbd73..54e027a614 100644 --- a/tests/components/cs5460a/test.esp32-idf.yaml +++ b/tests/components/cs5460a/test.esp32-idf.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 16 - mosi_pin: 17 - miso_pin: 15 +substitutions: + clk_pin: GPIO16 + mosi_pin: GPIO17 + miso_pin: GPIO15 + cs_pin: GPIO5 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 12 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp8266-ard.yaml b/tests/components/cs5460a/test.esp8266-ard.yaml index c5a458d0ec..dbd158d030 100644 --- a/tests/components/cs5460a/test.esp8266-ard.yaml +++ b/tests/components/cs5460a/test.esp8266-ard.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 14 - mosi_pin: 13 - miso_pin: 12 +substitutions: + clk_pin: GPIO14 + mosi_pin: GPIO13 + miso_pin: GPIO12 + cs_pin: GPIO15 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 15 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cs5460a/test.rp2040-ard.yaml b/tests/components/cs5460a/test.rp2040-ard.yaml index f3daf7d72d..f6c3f1eeca 100644 --- a/tests/components/cs5460a/test.rp2040-ard.yaml +++ b/tests/components/cs5460a/test.rp2040-ard.yaml @@ -1,27 +1,7 @@ -spi: - - id: spi_cs5460a - clk_pin: 2 - mosi_pin: 3 - miso_pin: 4 +substitutions: + clk_pin: GPIO2 + mosi_pin: GPIO3 + miso_pin: GPIO4 + cs_pin: GPIO5 -sensor: - - platform: cs5460a - id: cs5460a1 - cs_pin: 6 - current: - name: Socket current - voltage: - name: Mains voltage - power: - name: Socket power - on_value: - then: - cs5460a.restart: cs5460a1 - samples: 1600 - pga_gain: 10X - current_gain: 0.01 - voltage_gain: 0.000573 - current_hpf: true - voltage_hpf: true - phase_offset: 20 - pulse_energy: 0.01 kWh +<<: !include common.yaml diff --git a/tests/components/cse7761/common.yaml b/tests/components/cse7761/common.yaml new file mode 100644 index 0000000000..60cce3864a --- /dev/null +++ b/tests/components/cse7761/common.yaml @@ -0,0 +1,18 @@ +uart: + - id: uart_cse7761 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 + +sensor: + - platform: cse7761 + voltage: + name: CSE7761 Voltage + current_1: + name: CSE7761 Current 1 + current_2: + name: CSE7761 Current 2 + active_power_1: + name: CSE7761 Active Power 1 + active_power_2: + name: CSE7761 Active Power 2 diff --git a/tests/components/cse7761/test.esp32-ard.yaml b/tests/components/cse7761/test.esp32-ard.yaml index 4174e9a92e..811f6b72a6 100644 --- a/tests/components/cse7761/test.esp32-ard.yaml +++ b/tests/components/cse7761/test.esp32-ard.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 17 - rx_pin: - number: 16 - baud_rate: 38400 +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7761/test.esp32-c3-ard.yaml b/tests/components/cse7761/test.esp32-c3-ard.yaml index 581db24fd5..c79d14c740 100644 --- a/tests/components/cse7761/test.esp32-c3-ard.yaml +++ b/tests/components/cse7761/test.esp32-c3-ard.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 38400 +substitutions: + tx_pin: GPIO7 + rx_pin: GPIO8 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7761/test.esp32-c3-idf.yaml b/tests/components/cse7761/test.esp32-c3-idf.yaml index 581db24fd5..c79d14c740 100644 --- a/tests/components/cse7761/test.esp32-c3-idf.yaml +++ b/tests/components/cse7761/test.esp32-c3-idf.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 38400 +substitutions: + tx_pin: GPIO7 + rx_pin: GPIO8 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7761/test.esp32-idf.yaml b/tests/components/cse7761/test.esp32-idf.yaml index 4174e9a92e..811f6b72a6 100644 --- a/tests/components/cse7761/test.esp32-idf.yaml +++ b/tests/components/cse7761/test.esp32-idf.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 17 - rx_pin: - number: 16 - baud_rate: 38400 +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7761/test.esp8266-ard.yaml b/tests/components/cse7761/test.esp8266-ard.yaml index 581db24fd5..3b44f9c9c3 100644 --- a/tests/components/cse7761/test.esp8266-ard.yaml +++ b/tests/components/cse7761/test.esp8266-ard.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 38400 +substitutions: + tx_pin: GPIO1 + rx_pin: GPIO3 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7761/test.rp2040-ard.yaml b/tests/components/cse7761/test.rp2040-ard.yaml index 581db24fd5..b516342f3b 100644 --- a/tests/components/cse7761/test.rp2040-ard.yaml +++ b/tests/components/cse7761/test.rp2040-ard.yaml @@ -1,20 +1,5 @@ -uart: - - id: uart_cse7761 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 38400 +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: cse7761 - voltage: - name: CSE7761 Voltage - current_1: - name: CSE7761 Current 1 - current_2: - name: CSE7761 Current 2 - active_power_1: - name: CSE7761 Active Power 1 - active_power_2: - name: CSE7761 Active Power 2 +<<: !include common.yaml diff --git a/tests/components/cse7766/common.yaml b/tests/components/cse7766/common.yaml new file mode 100644 index 0000000000..f12b135a77 --- /dev/null +++ b/tests/components/cse7766/common.yaml @@ -0,0 +1,15 @@ +uart: + - id: uart_cse7766 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN + +sensor: + - platform: cse7766 + voltage: + name: CSE7766 Voltage + current: + name: CSE7766 Current + power: + name: CSE776 Power diff --git a/tests/components/cse7766/test.esp32-ard.yaml b/tests/components/cse7766/test.esp32-ard.yaml index 5542b52824..811f6b72a6 100644 --- a/tests/components/cse7766/test.esp32-ard.yaml +++ b/tests/components/cse7766/test.esp32-ard.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 17 - rx_pin: - number: 16 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cse7766/test.esp32-c3-ard.yaml b/tests/components/cse7766/test.esp32-c3-ard.yaml index d27c9d4463..c79d14c740 100644 --- a/tests/components/cse7766/test.esp32-c3-ard.yaml +++ b/tests/components/cse7766/test.esp32-c3-ard.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO7 + rx_pin: GPIO8 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cse7766/test.esp32-c3-idf.yaml b/tests/components/cse7766/test.esp32-c3-idf.yaml index d27c9d4463..c79d14c740 100644 --- a/tests/components/cse7766/test.esp32-c3-idf.yaml +++ b/tests/components/cse7766/test.esp32-c3-idf.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO7 + rx_pin: GPIO8 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cse7766/test.esp32-idf.yaml b/tests/components/cse7766/test.esp32-idf.yaml index 5542b52824..811f6b72a6 100644 --- a/tests/components/cse7766/test.esp32-idf.yaml +++ b/tests/components/cse7766/test.esp32-idf.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 17 - rx_pin: - number: 16 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO12 + rx_pin: GPIO14 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cse7766/test.esp8266-ard.yaml b/tests/components/cse7766/test.esp8266-ard.yaml index d27c9d4463..3b44f9c9c3 100644 --- a/tests/components/cse7766/test.esp8266-ard.yaml +++ b/tests/components/cse7766/test.esp8266-ard.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO1 + rx_pin: GPIO3 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cse7766/test.rp2040-ard.yaml b/tests/components/cse7766/test.rp2040-ard.yaml index d27c9d4463..b516342f3b 100644 --- a/tests/components/cse7766/test.rp2040-ard.yaml +++ b/tests/components/cse7766/test.rp2040-ard.yaml @@ -1,17 +1,5 @@ -uart: - - id: uart_cse7766 - tx_pin: - number: 4 - rx_pin: - number: 5 - baud_rate: 4800 - parity: EVEN +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 -sensor: - - platform: cse7766 - voltage: - name: CSE7766 Voltage - current: - name: CSE7766 Current - power: - name: CSE776 Power +<<: !include common.yaml diff --git a/tests/components/cst226/common.yaml b/tests/components/cst226/common.yaml index 7e1c5dde36..c12d8d872c 100644 --- a/tests/components/cst226/common.yaml +++ b/tests/components/cst226/common.yaml @@ -1,25 +1,25 @@ +i2c: + - id: i2c_cst226 + scl: ${scl_pin} + sda: ${sda_pin} + spi: - - id: spi_id_1 - clk_pin: GPIO7 - mosi_pin: GPIO6 - interface: any + - id: spi_ili9xxx + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} display: - - platform: ili9xxx - id: displ8 + - id: my_display + platform: ili9xxx model: ili9342 - cs_pin: GPIO5 - dc_pin: GPIO4 - reset_pin: - number: GPIO21 + cs_pin: ${cs_pin} + dc_pin: ${dc_pin} + reset_pin: ${disp_reset_pin} invert_colors: false -i2c: - scl: GPIO18 - sda: GPIO8 - touchscreen: - - platform: cst226 - interrupt_pin: GPIO3 - reset_pin: GPIO20 + - id: ts_cst226 + platform: cst226 + interrupt_pin: ${interrupt_pin} + reset_pin: ${reset_pin} diff --git a/tests/components/cst226/test.esp32-ard.yaml b/tests/components/cst226/test.esp32-ard.yaml new file mode 100644 index 0000000000..11e2c4fd43 --- /dev/null +++ b/tests/components/cst226/test.esp32-ard.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO0 + mosi_pin: GPIO2 + cs_pin: GPIO4 + dc_pin: GPIO5 + disp_reset_pin: GPIO12 + scl_pin: GPIO13 + sda_pin: GPIO14 + interrupt_pin: GPIO15 + reset_pin: GPIO16 + +<<: !include common.yaml diff --git a/tests/components/cst226/test.esp32-c3-ard.yaml b/tests/components/cst226/test.esp32-c3-ard.yaml index dade44d145..2f9bd72882 100644 --- a/tests/components/cst226/test.esp32-c3-ard.yaml +++ b/tests/components/cst226/test.esp32-c3-ard.yaml @@ -1 +1,12 @@ +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + cs_pin: GPIO8 + dc_pin: GPIO9 + disp_reset_pin: GPIO10 + scl_pin: GPIO0 + sda_pin: GPIO1 + interrupt_pin: GPIO2 + reset_pin: GPIO3 + <<: !include common.yaml diff --git a/tests/components/cst226/test.esp32-c3-idf.yaml b/tests/components/cst226/test.esp32-c3-idf.yaml new file mode 100644 index 0000000000..2f9bd72882 --- /dev/null +++ b/tests/components/cst226/test.esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + cs_pin: GPIO8 + dc_pin: GPIO9 + disp_reset_pin: GPIO10 + scl_pin: GPIO0 + sda_pin: GPIO1 + interrupt_pin: GPIO2 + reset_pin: GPIO3 + +<<: !include common.yaml diff --git a/tests/components/cst226/test.esp32-idf.yaml b/tests/components/cst226/test.esp32-idf.yaml new file mode 100644 index 0000000000..11e2c4fd43 --- /dev/null +++ b/tests/components/cst226/test.esp32-idf.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO0 + mosi_pin: GPIO2 + cs_pin: GPIO4 + dc_pin: GPIO5 + disp_reset_pin: GPIO12 + scl_pin: GPIO13 + sda_pin: GPIO14 + interrupt_pin: GPIO15 + reset_pin: GPIO16 + +<<: !include common.yaml diff --git a/tests/components/cst816/common.yaml b/tests/components/cst816/common.yaml index 765a353d1d..a4ac4aafec 100644 --- a/tests/components/cst816/common.yaml +++ b/tests/components/cst816/common.yaml @@ -1,27 +1,21 @@ -touchscreen: - - platform: cst816 - id: my_touchscreen - interrupt_pin: - number: 21 - reset_pin: GPIO16 - skip_probe: false - transform: - mirror_x: false - mirror_y: false - swap_xy: false - i2c: - sda: 3 - scl: 4 + - id: i2c_cst816 + scl: ${scl_pin} + sda: ${sda_pin} + +spi: + - id: spi_ili9xxx + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} display: - id: my_display platform: ili9xxx dimensions: 480x320 model: ST7796 - cs_pin: 18 - dc_pin: 20 - reset_pin: 22 + cs_pin: ${cs_pin} + dc_pin: ${dc_pin} + reset_pin: ${disp_reset_pin} transform: swap_xy: true mirror_x: true @@ -29,9 +23,16 @@ display: auto_clear_enabled: false invert_colors: false -spi: - clk_pin: 14 - mosi_pin: 13 +touchscreen: + - id: ts_cst816 + platform: cst816 + interrupt_pin: ${interrupt_pin} + reset_pin: ${reset_pin} + skip_probe: false + transform: + mirror_x: false + mirror_y: false + swap_xy: false binary_sensor: - platform: cst816 diff --git a/tests/components/cst816/test.esp32-ard.yaml b/tests/components/cst816/test.esp32-ard.yaml index dade44d145..11e2c4fd43 100644 --- a/tests/components/cst816/test.esp32-ard.yaml +++ b/tests/components/cst816/test.esp32-ard.yaml @@ -1 +1,12 @@ +substitutions: + clk_pin: GPIO0 + mosi_pin: GPIO2 + cs_pin: GPIO4 + dc_pin: GPIO5 + disp_reset_pin: GPIO12 + scl_pin: GPIO13 + sda_pin: GPIO14 + interrupt_pin: GPIO15 + reset_pin: GPIO16 + <<: !include common.yaml diff --git a/tests/components/cst816/test.esp32-c3-ard.yaml b/tests/components/cst816/test.esp32-c3-ard.yaml new file mode 100644 index 0000000000..2f9bd72882 --- /dev/null +++ b/tests/components/cst816/test.esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + cs_pin: GPIO8 + dc_pin: GPIO9 + disp_reset_pin: GPIO10 + scl_pin: GPIO0 + sda_pin: GPIO1 + interrupt_pin: GPIO2 + reset_pin: GPIO3 + +<<: !include common.yaml diff --git a/tests/components/cst816/test.esp32-c3-idf.yaml b/tests/components/cst816/test.esp32-c3-idf.yaml new file mode 100644 index 0000000000..2f9bd72882 --- /dev/null +++ b/tests/components/cst816/test.esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO6 + mosi_pin: GPIO7 + cs_pin: GPIO8 + dc_pin: GPIO9 + disp_reset_pin: GPIO10 + scl_pin: GPIO0 + sda_pin: GPIO1 + interrupt_pin: GPIO2 + reset_pin: GPIO3 + +<<: !include common.yaml diff --git a/tests/components/cst816/test.esp32-idf.yaml b/tests/components/cst816/test.esp32-idf.yaml new file mode 100644 index 0000000000..11e2c4fd43 --- /dev/null +++ b/tests/components/cst816/test.esp32-idf.yaml @@ -0,0 +1,12 @@ +substitutions: + clk_pin: GPIO0 + mosi_pin: GPIO2 + cs_pin: GPIO4 + dc_pin: GPIO5 + disp_reset_pin: GPIO12 + scl_pin: GPIO13 + sda_pin: GPIO14 + interrupt_pin: GPIO15 + reset_pin: GPIO16 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/common.yaml b/tests/components/ct_clamp/common.yaml new file mode 100644 index 0000000000..3ed9678447 --- /dev/null +++ b/tests/components/ct_clamp/common.yaml @@ -0,0 +1,9 @@ +sensor: + - platform: adc + id: esp_adc_sensor + pin: ${pin} + - platform: ct_clamp + sensor: esp_adc_sensor + name: CT Clamp + sample_duration: 500ms + update_interval: 5s diff --git a/tests/components/ct_clamp/test.esp32-ard.yaml b/tests/components/ct_clamp/test.esp32-ard.yaml index 1ea964fa96..0a70e3f733 100644 --- a/tests/components/ct_clamp/test.esp32-ard.yaml +++ b/tests/components/ct_clamp/test.esp32-ard.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: 39 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: GPIO39 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/test.esp32-c3-ard.yaml b/tests/components/ct_clamp/test.esp32-c3-ard.yaml index e25acc95e1..a8f29c98ae 100644 --- a/tests/components/ct_clamp/test.esp32-c3-ard.yaml +++ b/tests/components/ct_clamp/test.esp32-c3-ard.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: 0 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: GPIO0 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/test.esp32-c3-idf.yaml b/tests/components/ct_clamp/test.esp32-c3-idf.yaml index e25acc95e1..a8f29c98ae 100644 --- a/tests/components/ct_clamp/test.esp32-c3-idf.yaml +++ b/tests/components/ct_clamp/test.esp32-c3-idf.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: 0 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: GPIO0 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/test.esp32-idf.yaml b/tests/components/ct_clamp/test.esp32-idf.yaml index 1ea964fa96..0a70e3f733 100644 --- a/tests/components/ct_clamp/test.esp32-idf.yaml +++ b/tests/components/ct_clamp/test.esp32-idf.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: 39 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: GPIO39 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/test.esp8266-ard.yaml b/tests/components/ct_clamp/test.esp8266-ard.yaml index 9c7126480d..4a6d36cbb4 100644 --- a/tests/components/ct_clamp/test.esp8266-ard.yaml +++ b/tests/components/ct_clamp/test.esp8266-ard.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: A0 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: A0 + +<<: !include common.yaml diff --git a/tests/components/ct_clamp/test.rp2040-ard.yaml b/tests/components/ct_clamp/test.rp2040-ard.yaml index 47077308aa..9479437434 100644 --- a/tests/components/ct_clamp/test.rp2040-ard.yaml +++ b/tests/components/ct_clamp/test.rp2040-ard.yaml @@ -1,9 +1,4 @@ -sensor: - - platform: adc - id: esp_adc_sensor - pin: 26 - - platform: ct_clamp - sensor: esp_adc_sensor - name: CT Clamp - sample_duration: 500ms - update_interval: 5s +substitutions: + pin: GPIO26 + +<<: !include common.yaml diff --git a/tests/components/current_based/common.yaml b/tests/components/current_based/common.yaml new file mode 100644 index 0000000000..25dc9671b7 --- /dev/null +++ b/tests/components/current_based/common.yaml @@ -0,0 +1,68 @@ +i2c: + - id: i2c_ade7953 + scl: ${scl_pin} + sda: ${sda_pin} + +sensor: + - platform: ade7953_i2c + irq_pin: ${irq_pin} + voltage: + name: ADE7953 Voltage + id: ade7953_voltage + current_a: + name: ADE7953 Current A + id: ade7953_current_a + current_b: + name: ADE7953 Current B + id: ade7953_current_b + power_factor_a: + name: ADE7953 Power Factor A + power_factor_b: + name: ADE7953 Power Factor B + apparent_power_a: + name: ADE7953 Apparent Power A + apparent_power_b: + name: ADE7953 Apparent Power B + active_power_a: + name: ADE7953 Active Power A + active_power_b: + name: ADE7953 Active Power B + reactive_power_a: + name: ADE7953 Reactive Power A + reactive_power_b: + name: ADE7953 Reactive Power B + update_interval: 1s + +switch: + - platform: template + id: template_switch1 + optimistic: true + - platform: template + id: template_switch2 + optimistic: true + +cover: + - platform: current_based + name: Current Based Cover + id: current_based_cover + open_sensor: ade7953_current_a + open_moving_current_threshold: 0.5 + open_obstacle_current_threshold: 0.8 + open_duration: 12s + open_action: + - switch.turn_on: template_switch1 + close_sensor: ade7953_current_b + close_moving_current_threshold: 0.5 + close_obstacle_current_threshold: 0.8 + close_duration: 10s + close_action: + - switch.turn_on: template_switch2 + stop_action: + - switch.turn_off: template_switch1 + - switch.turn_off: template_switch2 + obstacle_rollback: 30% + start_sensing_delay: 0.8s + malfunction_detection: true + malfunction_action: + then: + - logger.log: Malfunction Detected diff --git a/tests/components/current_based/test.esp32-ard.yaml b/tests/components/current_based/test.esp32-ard.yaml index 90781120bc..2c57d412f6 100644 --- a/tests/components/current_based/test.esp32-ard.yaml +++ b/tests/components/current_based/test.esp32-ard.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + irq_pin: GPIO15 -sensor: - - platform: ade7953_i2c - irq_pin: 15 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/current_based/test.esp32-c3-ard.yaml b/tests/components/current_based/test.esp32-c3-ard.yaml index 69ab8830c3..799acabd5a 100644 --- a/tests/components/current_based/test.esp32-c3-ard.yaml +++ b/tests/components/current_based/test.esp32-c3-ard.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + irq_pin: GPIO6 -sensor: - - platform: ade7953_i2c - irq_pin: 6 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/current_based/test.esp32-c3-idf.yaml b/tests/components/current_based/test.esp32-c3-idf.yaml index 69ab8830c3..799acabd5a 100644 --- a/tests/components/current_based/test.esp32-c3-idf.yaml +++ b/tests/components/current_based/test.esp32-c3-idf.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + irq_pin: GPIO6 -sensor: - - platform: ade7953_i2c - irq_pin: 6 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/current_based/test.esp32-idf.yaml b/tests/components/current_based/test.esp32-idf.yaml index 90781120bc..2c57d412f6 100644 --- a/tests/components/current_based/test.esp32-idf.yaml +++ b/tests/components/current_based/test.esp32-idf.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 16 - sda: 17 +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + irq_pin: GPIO15 -sensor: - - platform: ade7953_i2c - irq_pin: 15 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/current_based/test.esp8266-ard.yaml b/tests/components/current_based/test.esp8266-ard.yaml index 42d6d4676b..c8e6a43f44 100644 --- a/tests/components/current_based/test.esp8266-ard.yaml +++ b/tests/components/current_based/test.esp8266-ard.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + irq_pin: GPIO15 -sensor: - - platform: ade7953_i2c - irq_pin: 15 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/current_based/test.rp2040-ard.yaml b/tests/components/current_based/test.rp2040-ard.yaml index 69ab8830c3..799acabd5a 100644 --- a/tests/components/current_based/test.rp2040-ard.yaml +++ b/tests/components/current_based/test.rp2040-ard.yaml @@ -1,68 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: 5 - sda: 4 +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + irq_pin: GPIO6 -sensor: - - platform: ade7953_i2c - irq_pin: 6 - voltage: - name: ADE7953 Voltage - id: ade7953_voltage - current_a: - name: ADE7953 Current A - id: ade7953_current_a - current_b: - name: ADE7953 Current B - id: ade7953_current_b - power_factor_a: - name: ADE7953 Power Factor A - power_factor_b: - name: ADE7953 Power Factor B - apparent_power_a: - name: ADE7953 Apparent Power A - apparent_power_b: - name: ADE7953 Apparent Power B - active_power_a: - name: ADE7953 Active Power A - active_power_b: - name: ADE7953 Active Power B - reactive_power_a: - name: ADE7953 Reactive Power A - reactive_power_b: - name: ADE7953 Reactive Power B - update_interval: 1s - -switch: - - platform: template - id: template_switch1 - optimistic: true - - platform: template - id: template_switch2 - optimistic: true - -cover: - - platform: current_based - name: Current Based Cover - id: current_based_cover - open_sensor: ade7953_current_a - open_moving_current_threshold: 0.5 - open_obstacle_current_threshold: 0.8 - open_duration: 12s - open_action: - - switch.turn_on: template_switch1 - close_sensor: ade7953_current_b - close_moving_current_threshold: 0.5 - close_obstacle_current_threshold: 0.8 - close_duration: 10s - close_action: - - switch.turn_on: template_switch2 - stop_action: - - switch.turn_off: template_switch1 - - switch.turn_off: template_switch2 - obstacle_rollback: 30% - start_sensing_delay: 0.8s - malfunction_detection: true - malfunction_action: - then: - - logger.log: Malfunction Detected +<<: !include common.yaml diff --git a/tests/components/cwww/common.yaml b/tests/components/cwww/common.yaml new file mode 100644 index 0000000000..0ad5beeaae --- /dev/null +++ b/tests/components/cwww/common.yaml @@ -0,0 +1,16 @@ +output: + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} + +light: + - platform: cwww + name: CWWW Light + cold_white: light_output_1 + warm_white: light_output_2 + cold_white_color_temperature: 153 mireds + warm_white_color_temperature: 500 mireds + constant_brightness: true diff --git a/tests/components/cwww/test.esp32-ard.yaml b/tests/components/cwww/test.esp32-ard.yaml index f108d96ad3..1831adda6e 100644 --- a/tests/components/cwww/test.esp32-ard.yaml +++ b/tests/components/cwww/test.esp32-ard.yaml @@ -1,16 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 12 - - platform: ledc - id: light_output_2 - pin: 13 +substitutions: + light_platform: ledc + pin_o1: GPIO16 + pin_o2: GPIO17 -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true +<<: !include common.yaml diff --git a/tests/components/cwww/test.esp32-c3-ard.yaml b/tests/components/cwww/test.esp32-c3-ard.yaml index c829ca2a2b..016f315d9f 100644 --- a/tests/components/cwww/test.esp32-c3-ard.yaml +++ b/tests/components/cwww/test.esp32-c3-ard.yaml @@ -1,16 +1,6 @@ -output: - - platform: ledc - id: light_output_1 - pin: 1 - - platform: ledc - id: light_output_2 - pin: 2 +substitutions: + light_platform: ledc + pin_o1: GPIO6 + pin_o2: GPIO7 -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true +<<: !include common.yaml diff --git a/tests/components/cwww/test.esp32-c3-idf.yaml b/tests/components/cwww/test.esp32-c3-idf.yaml index 2760a167ee..982394ded6 100644 --- a/tests/components/cwww/test.esp32-c3-idf.yaml +++ b/tests/components/cwww/test.esp32-c3-idf.yaml @@ -1,19 +1,14 @@ +substitutions: + light_platform: ledc + pin_o1: GPIO6 + pin_o2: GPIO7 + +packages: + device_base: !include common.yaml + output: - - platform: ledc - id: light_output_1 - pin: 1 + - id: !extend light_output_1 channel: 0 - - platform: ledc - id: light_output_2 - pin: 2 + - id: !extend light_output_2 channel: 1 phase_angle: 180° - -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true diff --git a/tests/components/cwww/test.esp32-idf.yaml b/tests/components/cwww/test.esp32-idf.yaml index 27fa160e56..d2a998e6b3 100644 --- a/tests/components/cwww/test.esp32-idf.yaml +++ b/tests/components/cwww/test.esp32-idf.yaml @@ -1,19 +1,14 @@ +substitutions: + light_platform: ledc + pin_o1: GPIO16 + pin_o2: GPIO17 + +packages: + device_base: !include common.yaml + output: - - platform: ledc - id: light_output_1 - pin: 12 + - id: !extend light_output_1 channel: 0 - - platform: ledc - id: light_output_2 - pin: 13 + - id: !extend light_output_2 channel: 1 phase_angle: 180° - -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true diff --git a/tests/components/cwww/test.esp8266-ard.yaml b/tests/components/cwww/test.esp8266-ard.yaml index 50c311f616..75a5b9d64d 100644 --- a/tests/components/cwww/test.esp8266-ard.yaml +++ b/tests/components/cwww/test.esp8266-ard.yaml @@ -1,16 +1,6 @@ -output: - - platform: esp8266_pwm - id: light_output_1 - pin: 12 - - platform: esp8266_pwm - id: light_output_2 - pin: 13 +substitutions: + light_platform: esp8266_pwm + pin_o1: GPIO12 + pin_o2: GPIO13 -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true +<<: !include common.yaml diff --git a/tests/components/cwww/test.rp2040-ard.yaml b/tests/components/cwww/test.rp2040-ard.yaml index 505d67f862..537177aca1 100644 --- a/tests/components/cwww/test.rp2040-ard.yaml +++ b/tests/components/cwww/test.rp2040-ard.yaml @@ -1,16 +1,6 @@ -output: - - platform: rp2040_pwm - id: light_output_1 - pin: 12 - - platform: rp2040_pwm - id: light_output_2 - pin: 13 +substitutions: + light_platform: rp2040_pwm + pin_o1: GPIO12 + pin_o2: GPIO13 -light: - - platform: cwww - name: CWWW Light - cold_white: light_output_1 - warm_white: light_output_2 - cold_white_color_temperature: 153 mireds - warm_white_color_temperature: 500 mireds - constant_brightness: true +<<: !include common.yaml