1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 06:45:48 +00:00

[tests] Migrate components to shared packages and fix ID ambiguity (#11819)

This commit is contained in:
J. Nick Koston
2025-11-10 19:00:54 -06:00
committed by GitHub
parent 1cccfdd2b9
commit 82692d7053
14 changed files with 111 additions and 165 deletions

View File

@@ -86,6 +86,7 @@ ISOLATED_COMPONENTS = {
"modbus_controller": "Defines multiple modbus buses for testing client/server functionality - conflicts with package modbus bus",
"neopixelbus": "RMT type conflict with ESP32 Arduino/ESP-IDF headers (enum vs struct rmt_channel_t)",
"packages": "cannot merge packages",
"tinyusb": "Conflicts with usb_host component - cannot be used together",
}

View File

@@ -16,5 +16,6 @@ display:
touchscreen:
- platform: chsc6x
i2c_id: i2c_bus
display: ili9xxx_display
interrupt_pin: 22

View File

@@ -0,0 +1,41 @@
esphome:
on_boot:
then:
- hlk_fm22x.enroll:
name: "Test"
direction: 1
- hlk_fm22x.delete_all:
hlk_fm22x:
on_face_scan_matched:
- logger.log: test_hlk_22x_face_scan_matched
on_face_scan_unmatched:
- logger.log: test_hlk_22x_face_scan_unmatched
on_face_scan_invalid:
- logger.log: test_hlk_22x_face_scan_invalid
on_face_info:
- logger.log: test_hlk_22x_face_info
on_enrollment_done:
- logger.log: test_hlk_22x_enrollment_done
on_enrollment_failed:
- logger.log: test_hlk_22x_enrollment_failed
sensor:
- platform: hlk_fm22x
face_count:
name: "Face Count"
last_face_id:
name: "Last Face ID"
status:
name: "Face Status"
binary_sensor:
- platform: hlk_fm22x
name: "Face Enrolling"
text_sensor:
- platform: hlk_fm22x
version:
name: "HLK Version"
last_face_name:
name: "Last Face Name"

View File

@@ -1,47 +1,4 @@
esphome:
on_boot:
then:
- hlk_fm22x.enroll:
name: "Test"
direction: 1
- hlk_fm22x.delete_all:
packages:
uart: !include ../../test_build_components/common/uart/esp32-idf.yaml
uart:
- id: uart_hlk_fm22x
tx_pin: 17
rx_pin: 16
baud_rate: 115200
hlk_fm22x:
on_face_scan_matched:
- logger.log: test_hlk_22x_face_scan_matched
on_face_scan_unmatched:
- logger.log: test_hlk_22x_face_scan_unmatched
on_face_scan_invalid:
- logger.log: test_hlk_22x_face_scan_invalid
on_face_info:
- logger.log: test_hlk_22x_face_info
on_enrollment_done:
- logger.log: test_hlk_22x_enrollment_done
on_enrollment_failed:
- logger.log: test_hlk_22x_enrollment_failed
sensor:
- platform: hlk_fm22x
face_count:
name: "Face Count"
last_face_id:
name: "Last Face ID"
status:
name: "Face Status"
binary_sensor:
- platform: hlk_fm22x
name: "Face Enrolling"
text_sensor:
- platform: hlk_fm22x
version:
name: "HLK Version"
last_face_name:
name: "Last Face Name"
<<: !include common.yaml

View File

@@ -1,47 +1,4 @@
esphome:
on_boot:
then:
- hlk_fm22x.enroll:
name: "Test"
direction: 1
- hlk_fm22x.delete_all:
packages:
uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml
uart:
- id: uart_hlk_fm22x
tx_pin: 4
rx_pin: 5
baud_rate: 115200
hlk_fm22x:
on_face_scan_matched:
- logger.log: test_hlk_22x_face_scan_matched
on_face_scan_unmatched:
- logger.log: test_hlk_22x_face_scan_unmatched
on_face_scan_invalid:
- logger.log: test_hlk_22x_face_scan_invalid
on_face_info:
- logger.log: test_hlk_22x_face_info
on_enrollment_done:
- logger.log: test_hlk_22x_enrollment_done
on_enrollment_failed:
- logger.log: test_hlk_22x_enrollment_failed
sensor:
- platform: hlk_fm22x
face_count:
name: "Face Count"
last_face_id:
name: "Last Face ID"
status:
name: "Face Status"
binary_sensor:
- platform: hlk_fm22x
name: "Face Enrolling"
text_sensor:
- platform: hlk_fm22x
version:
name: "HLK Version"
last_face_name:
name: "Last Face Name"
<<: !include common.yaml

View File

@@ -1,47 +1,4 @@
esphome:
on_boot:
then:
- hlk_fm22x.enroll:
name: "Test"
direction: 1
- hlk_fm22x.delete_all:
packages:
uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml
uart:
- id: uart_hlk_fm22x
tx_pin: 4
rx_pin: 5
baud_rate: 115200
hlk_fm22x:
on_face_scan_matched:
- logger.log: test_hlk_22x_face_scan_matched
on_face_scan_unmatched:
- logger.log: test_hlk_22x_face_scan_unmatched
on_face_scan_invalid:
- logger.log: test_hlk_22x_face_scan_invalid
on_face_info:
- logger.log: test_hlk_22x_face_info
on_enrollment_done:
- logger.log: test_hlk_22x_enrollment_done
on_enrollment_failed:
- logger.log: test_hlk_22x_enrollment_failed
sensor:
- platform: hlk_fm22x
face_count:
name: "Face Count"
last_face_id:
name: "Last Face ID"
status:
name: "Face Status"
binary_sensor:
- platform: hlk_fm22x
name: "Face Enrolling"
text_sensor:
- platform: hlk_fm22x
version:
name: "HLK Version"
last_face_name:
name: "Last Face Name"
<<: !include common.yaml

View File

@@ -11,25 +11,41 @@ esphome:
on_boot:
then:
- speaker.mute_on:
id: speaker_id
- speaker.mute_off:
id: speaker_id
- if:
condition: speaker.is_stopped
condition:
speaker.is_stopped:
id: speaker_id
then:
- speaker.play: [0, 1, 2, 3]
- speaker.volume_set: 0.9
- speaker.play:
id: speaker_id
data: [0, 1, 2, 3]
- speaker.volume_set:
id: speaker_id
volume: 0.9
- if:
condition: speaker.is_playing
condition:
speaker.is_playing:
id: speaker_id
then:
- speaker.finish:
id: speaker_id
- speaker.stop:
id: speaker_id
button:
- platform: template
name: "Speaker Button"
on_press:
then:
- speaker.play: [0x10, 0x20, 0x30, 0x40]
- speaker.play: !lambda |-
- speaker.play:
id: speaker_id
data: [0x10, 0x20, 0x30, 0x40]
- speaker.play:
id: speaker_id
data: !lambda |-
return {0x01, 0x02, (uint8_t)id(my_number).state};
i2s_audio:

View File

@@ -1,11 +1,3 @@
remote_transmitter:
pin: ${tx_pin}
carrier_duty_percent: 50%
remote_receiver:
id: rcvr
pin: ${rx_pin}
climate:
- platform: toshiba
name: "RAS-2819T Climate"

View File

@@ -1,5 +1,5 @@
substitutions:
tx_pin: GPIO5
rx_pin: GPIO4
packages:
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-ard.yaml
<<: !include common_ras2819t.yaml

View File

@@ -1,5 +1,5 @@
substitutions:
tx_pin: GPIO5
rx_pin: GPIO4
packages:
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-c3-ard.yaml
<<: !include common_ras2819t.yaml

View File

@@ -1,5 +1,5 @@
substitutions:
tx_pin: GPIO5
rx_pin: GPIO4
packages:
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-idf.yaml
<<: !include common_ras2819t.yaml

View File

@@ -1,5 +1,5 @@
substitutions:
tx_pin: GPIO5
rx_pin: GPIO4
packages:
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp8266-ard.yaml
<<: !include common_ras2819t.yaml

View File

@@ -0,0 +1,12 @@
# Common remote_receiver configuration for ESP32 Arduino tests
# Provides a shared remote receiver that all components can use
# Components will auto-use this receiver if they don't specify receiver_id
substitutions:
remote_receiver_pin: GPIO32
remote_receiver:
- id: rcvr
pin: ${remote_receiver_pin}
dump: all
tolerance: 25%

View File

@@ -0,0 +1,12 @@
# Common remote_receiver configuration for ESP32-C3 Arduino tests
# Provides a shared remote receiver that all components can use
# Components will auto-use this receiver if they don't specify receiver_id
substitutions:
remote_receiver_pin: GPIO10
remote_receiver:
- id: rcvr
pin: ${remote_receiver_pin}
dump: all
tolerance: 25%