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:
@@ -86,6 +86,7 @@ ISOLATED_COMPONENTS = {
|
|||||||
"modbus_controller": "Defines multiple modbus buses for testing client/server functionality - conflicts with package modbus bus",
|
"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)",
|
"neopixelbus": "RMT type conflict with ESP32 Arduino/ESP-IDF headers (enum vs struct rmt_channel_t)",
|
||||||
"packages": "cannot merge packages",
|
"packages": "cannot merge packages",
|
||||||
|
"tinyusb": "Conflicts with usb_host component - cannot be used together",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,5 +16,6 @@ display:
|
|||||||
|
|
||||||
touchscreen:
|
touchscreen:
|
||||||
- platform: chsc6x
|
- platform: chsc6x
|
||||||
|
i2c_id: i2c_bus
|
||||||
display: ili9xxx_display
|
display: ili9xxx_display
|
||||||
interrupt_pin: 22
|
interrupt_pin: 22
|
||||||
|
|||||||
41
tests/components/hlk_fm22x/common.yaml
Normal file
41
tests/components/hlk_fm22x/common.yaml
Normal 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"
|
||||||
@@ -1,47 +1,4 @@
|
|||||||
esphome:
|
packages:
|
||||||
on_boot:
|
uart: !include ../../test_build_components/common/uart/esp32-idf.yaml
|
||||||
then:
|
|
||||||
- hlk_fm22x.enroll:
|
|
||||||
name: "Test"
|
|
||||||
direction: 1
|
|
||||||
- hlk_fm22x.delete_all:
|
|
||||||
|
|
||||||
uart:
|
<<: !include common.yaml
|
||||||
- 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"
|
|
||||||
|
|||||||
@@ -1,47 +1,4 @@
|
|||||||
esphome:
|
packages:
|
||||||
on_boot:
|
uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml
|
||||||
then:
|
|
||||||
- hlk_fm22x.enroll:
|
|
||||||
name: "Test"
|
|
||||||
direction: 1
|
|
||||||
- hlk_fm22x.delete_all:
|
|
||||||
|
|
||||||
uart:
|
<<: !include common.yaml
|
||||||
- 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"
|
|
||||||
|
|||||||
@@ -1,47 +1,4 @@
|
|||||||
esphome:
|
packages:
|
||||||
on_boot:
|
uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml
|
||||||
then:
|
|
||||||
- hlk_fm22x.enroll:
|
|
||||||
name: "Test"
|
|
||||||
direction: 1
|
|
||||||
- hlk_fm22x.delete_all:
|
|
||||||
|
|
||||||
uart:
|
<<: !include common.yaml
|
||||||
- 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"
|
|
||||||
|
|||||||
@@ -11,26 +11,42 @@ esphome:
|
|||||||
on_boot:
|
on_boot:
|
||||||
then:
|
then:
|
||||||
- speaker.mute_on:
|
- speaker.mute_on:
|
||||||
|
id: speaker_id
|
||||||
- speaker.mute_off:
|
- speaker.mute_off:
|
||||||
|
id: speaker_id
|
||||||
- if:
|
- if:
|
||||||
condition: speaker.is_stopped
|
condition:
|
||||||
|
speaker.is_stopped:
|
||||||
|
id: speaker_id
|
||||||
then:
|
then:
|
||||||
- speaker.play: [0, 1, 2, 3]
|
- speaker.play:
|
||||||
- speaker.volume_set: 0.9
|
id: speaker_id
|
||||||
|
data: [0, 1, 2, 3]
|
||||||
|
- speaker.volume_set:
|
||||||
|
id: speaker_id
|
||||||
|
volume: 0.9
|
||||||
- if:
|
- if:
|
||||||
condition: speaker.is_playing
|
condition:
|
||||||
|
speaker.is_playing:
|
||||||
|
id: speaker_id
|
||||||
then:
|
then:
|
||||||
- speaker.finish:
|
- speaker.finish:
|
||||||
|
id: speaker_id
|
||||||
- speaker.stop:
|
- speaker.stop:
|
||||||
|
id: speaker_id
|
||||||
|
|
||||||
button:
|
button:
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Speaker Button"
|
name: "Speaker Button"
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
- speaker.play: [0x10, 0x20, 0x30, 0x40]
|
- speaker.play:
|
||||||
- speaker.play: !lambda |-
|
id: speaker_id
|
||||||
return {0x01, 0x02, (uint8_t)id(my_number).state};
|
data: [0x10, 0x20, 0x30, 0x40]
|
||||||
|
- speaker.play:
|
||||||
|
id: speaker_id
|
||||||
|
data: !lambda |-
|
||||||
|
return {0x01, 0x02, (uint8_t)id(my_number).state};
|
||||||
|
|
||||||
i2s_audio:
|
i2s_audio:
|
||||||
i2s_lrclk_pin: ${i2s_bclk_pin}
|
i2s_lrclk_pin: ${i2s_bclk_pin}
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
remote_transmitter:
|
|
||||||
pin: ${tx_pin}
|
|
||||||
carrier_duty_percent: 50%
|
|
||||||
|
|
||||||
remote_receiver:
|
|
||||||
id: rcvr
|
|
||||||
pin: ${rx_pin}
|
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: toshiba
|
- platform: toshiba
|
||||||
name: "RAS-2819T Climate"
|
name: "RAS-2819T Climate"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
substitutions:
|
packages:
|
||||||
tx_pin: GPIO5
|
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml
|
||||||
rx_pin: GPIO4
|
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-ard.yaml
|
||||||
|
|
||||||
<<: !include common_ras2819t.yaml
|
<<: !include common_ras2819t.yaml
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
substitutions:
|
packages:
|
||||||
tx_pin: GPIO5
|
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml
|
||||||
rx_pin: GPIO4
|
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-c3-ard.yaml
|
||||||
|
|
||||||
<<: !include common_ras2819t.yaml
|
<<: !include common_ras2819t.yaml
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
substitutions:
|
packages:
|
||||||
tx_pin: GPIO5
|
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml
|
||||||
rx_pin: GPIO4
|
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-idf.yaml
|
||||||
|
|
||||||
<<: !include common_ras2819t.yaml
|
<<: !include common_ras2819t.yaml
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
substitutions:
|
packages:
|
||||||
tx_pin: GPIO5
|
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml
|
||||||
rx_pin: GPIO4
|
remote_receiver: !include ../../test_build_components/common/remote_receiver/esp8266-ard.yaml
|
||||||
|
|
||||||
<<: !include common_ras2819t.yaml
|
<<: !include common_ras2819t.yaml
|
||||||
|
|||||||
@@ -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%
|
||||||
@@ -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%
|
||||||
Reference in New Issue
Block a user