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

[esp32_touch] Restore get_value() for ESP32-S2/S3 variants (#10112)

This commit is contained in:
J. Nick Koston
2025-08-06 16:21:32 -10:00
committed by GitHub
parent 1415e02e40
commit bfb14e1cf9
7 changed files with 42 additions and 12 deletions

View File

@@ -0,0 +1,18 @@
binary_sensor:
- platform: esp32_touch
name: ESP32 Touch Pad Get Value
pin: ${pin}
threshold: 1000
id: esp32_touch_pad_get_value
on_press:
then:
- lambda: |-
// Test that get_value() compiles and works
uint32_t value = id(esp32_touch_pad_get_value).get_value();
ESP_LOGD("test", "Touch value on press: %u", value);
on_release:
then:
- lambda: |-
// Test get_value() on release
uint32_t value = id(esp32_touch_pad_get_value).get_value();
ESP_LOGD("test", "Touch value on release: %u", value);

View File

@@ -2,3 +2,4 @@ substitutions:
pin: GPIO27
<<: !include common.yaml
<<: !include common-get-value.yaml

View File

@@ -2,3 +2,4 @@ substitutions:
pin: GPIO12
<<: !include common-variants.yaml
<<: !include common-get-value.yaml

View File

@@ -2,3 +2,4 @@ substitutions:
pin: GPIO12
<<: !include common-variants.yaml
<<: !include common-get-value.yaml