How do we use the onboard button on M5stack C3U as a switch?
light:
- platform: esp32_rmt_led_strip
rgb_order: GRB
pin: GPIO2
num_leds: 1
rmt_channel: 0
chipset: SK6812
name: "Green LED"
id: led
binary_sensor:
- platform: gpio
pin:
number: GPIO9
inverted: true
mode: INPUT_PULLUP
name: led_switched_on
on_press:
then:
- light.turn_on: led
- platform: gpio
pin:
number: GPIO9
inverted: true
mode: INPUT_PULLUP
name: led_switched_off
filters:
- delayed_on: 1000ms
on_press:
then:
- light.turn_off: led
came up this code
but is just any example for which more modifications are required.
`
better code by ssieb
binary_sensor:
- platform: gpio
id: g0
pin:
number: 0
mode: input_pullup
inverted: true
on_press:
- switch.turn_on: led
on_multi_click:
- timing:
- on for at least 1s
then:
- switch.turn_off: led
Is there a question here?
it was a question which got answered by great ssieb.