Why this error in Home Assistant ESPHome?

Hello, sort of new in Home Assistant and ESPhome…

I found this yaml file on internet, GitHub - altrnate32/esp-lg-control with thanks to @ altrnate32, and works, but in File Editor in Home Assistant I always see this error:
Don’t know how to solve…

Error:

unknown tag !<!lambda> (186:3)

183 | fsm.update_stooklijn();
184 | prev_oat = x;
185 | }
186 | - platform: modbus_controller
---------^
187 | modbus_controller_id: lg

Part of the yaml file which reports this error:

  - platform: modbus_controller
    modbus_controller_id: lg
    name: "Buitentemperatuur"
    id: buiten_temp
    register_type: read
    address: 12
    unit_of_measurement: "°C"
    value_type: S_WORD
    accuracy_decimals: 1
    icon: mdi:weather-cloudy
    filters:
      - multiply: 0.1
      - sliding_window_moving_average:
          window_size: 60
          send_every: 30
    on_value:
      then:
        - lambda: !lambda |-
            static float prev_oat = -100.0;
            if (abs(round(x) - round(prev_oat)) > 0.1) {
              fsm.update_stooklijn();
              prev_oat = x;
            }
  - platform: modbus_controller

Thanks!

Probably the lambda: !lambda bit. Why have you written it like that? See the docs: