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:
18
tests/components/esp32_touch/common-get-value.yaml
Normal file
18
tests/components/esp32_touch/common-get-value.yaml
Normal 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);
|
@@ -2,3 +2,4 @@ substitutions:
|
||||
pin: GPIO27
|
||||
|
||||
<<: !include common.yaml
|
||||
<<: !include common-get-value.yaml
|
||||
|
@@ -2,3 +2,4 @@ substitutions:
|
||||
pin: GPIO12
|
||||
|
||||
<<: !include common-variants.yaml
|
||||
<<: !include common-get-value.yaml
|
||||
|
@@ -2,3 +2,4 @@ substitutions:
|
||||
pin: GPIO12
|
||||
|
||||
<<: !include common-variants.yaml
|
||||
<<: !include common-get-value.yaml
|
||||
|
Reference in New Issue
Block a user