unknown tag <!lambda> when lambda used to return a value
marcoaddario opened this issue · 6 comments
Yes I'm getting this lambda unknown tag error in the yaml file in Home Assistant File Editor but not when editing from the ESPHome editor.
this is the code snippet
`binary_sensor:
- platform: gpio
id: gpio21
name: Water Sensor
pin:
number: 21
mode:
input: True
pullup: False
pulldown: True
filters:- delayed_on: 30ms
on_press:
then:- switch.turn_on: gpio2
- delay: !lambda "return id(glob_drain_delay) * 60000;" - switch.turn_off: gpio2
`
- switch.turn_on: gpio2
- delayed_on: 30ms
this is the error message
`unknown tag !<!lambda> (78:64)
75 | ...
76 | ...
77 | ...
78 | ... id(glob_drain_delay) * 60000;"
-----------------------------------------^
79 | ...
80 | ...`
In VSCode I'm getting Unresolved tag: !lambda YAML
However, if using the ESPHome Validator in VSCode with the ESPHome Extension installed I don't get an error.
Do you have the redhat yaml extension installed? Try disabling it for the workspace
If you want to keep the redhat yaml extension enabled you can add it as a custom tag in settings.json:
"yaml.customTags": [
"!lambda scalar"
]