Hya,
in the process of leaning ESPHome, i’m trying to get the gpio state ( $RES_PIN) , but it’s failing.
When compiling, i get:
Compiling .pioenvs/education/src/main.cpp.o
<unicode string>: In lambda function:
<unicode string>:74:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
*** [.pioenvs/education/src/main.cpp.o] Error 1
========================== [FAILED] Took 3.38 seconds ==========================
the code:
LED_PIN: GPIO13 # D7
BUT_PIN: GPIO12 # D6
RES_PIN: GPIO14 # D5
binary_sensor:
- platform: gpio
pin: $BUT_PIN
name: "Test LED Button"
id: toggle_led
on_press:
then:
switch.toggle: led_red
- platform: gpio
pin: $RES_PIN
name: "Resistance Wire"
id: resistance_wire
on_press:
then:
lambda: |-
return (id(resistance_wire).state);
- platform: template
name: "Led Status"
lambda: |-
return (id(led_red).state);
switch:
- platform: output
id: led_red
name: Output Led
output: output_led
output:
- platform: gpio
pin: $LED_PIN
inverted: false
id: output_led
Advises, please?