1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

[esp32_touch] Fix variants, add tests for variants (#8320)

This commit is contained in:
Keith Burzinski
2025-02-25 14:14:39 -06:00
committed by Jesse Hills
parent eca0c21966
commit 7114d6bdd1
9 changed files with 39 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ void ESP32TouchComponent::setup() {
} }
#endif #endif
#if ESP_IDF_VERSION_MAJOR >= 5 #if ESP_IDF_VERSION_MAJOR >= 5 && defined(USE_ESP32_VARIANT_ESP32)
touch_pad_set_measurement_clock_cycles(this->meas_cycle_); touch_pad_set_measurement_clock_cycles(this->meas_cycle_);
touch_pad_set_measurement_interval(this->sleep_cycle_); touch_pad_set_measurement_interval(this->sleep_cycle_);
#else #else

View File

@@ -0,0 +1,15 @@
esp32_touch:
setup_mode: false
sleep_duration: 27ms
measurement_duration: 8ms
low_voltage_reference: 0.5V
high_voltage_reference: 2.7V
voltage_attenuation: 1.5V
binary_sensor:
- platform: esp32_touch
name: ESP32 Touch Pad
pin: ${pin}
threshold: 1000
on_press:
- logger.log: "I'm touched!"

View File

@@ -10,7 +10,7 @@ esp32_touch:
binary_sensor: binary_sensor:
- platform: esp32_touch - platform: esp32_touch
name: ESP32 Touch Pad name: ESP32 Touch Pad
pin: 27 pin: ${pin}
threshold: 1000 threshold: 1000
on_press: on_press:
- logger.log: "I'm touched!" - logger.log: "I'm touched!"

View File

@@ -1 +1,4 @@
substitutions:
pin: GPIO27
<<: !include common.yaml <<: !include common.yaml

View File

@@ -1 +1,4 @@
substitutions:
pin: GPIO27
<<: !include common.yaml <<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
pin: GPIO12
<<: !include common-variants.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
pin: GPIO12
<<: !include common-variants.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
pin: GPIO12
<<: !include common-variants.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
pin: GPIO12
<<: !include common-variants.yaml