Ultrasonic sensor code not working after 1.12.1

i am having some problem after this latest update my ultrasonic sensor code is not working as it was before it is not giving the required data to work ,
just changed filter_nan to filter_out : nan

sensor:
  - platform: ultrasonic
    trigger_pin: GPIO13
    echo_pin: GPIO12
    name: "Down Tank Ultrasonic Sensor"
    accuracy_decimals: 00
    filters:
      - filter_out: nan
      - multiply: 2300
      - lambda: return 4500 - x;
# This value is 4200 ltr water + false 300 ltr water(gap between tank and sensor) - x (which is Value of remaining water in tank), where tank capacity= 4200 ltr,height of tank is 182cm, 1cm = 23 ltr
    unit_of_measurement: litre

this is what i am getting now

[01:43:11][D][time.homeassistant:029]: Synchronized time: Sun Mar 24 01:43:10 2019
[01:43:11][D][sensor.ultrasonic:049]: Got distance: 0.0 m
[01:43:11][D][sensor.sensor:100]: 'Down Tank Ultrasonic Sensor': Sending state 4415.58789 litre with 0 decimals of accuracy
[01:43:16][D][sensor.ultrasonic:049]: Got distance: 0.0 m
[01:43:16][D][sensor.sensor:100]: 'Down Tank Ultrasonic Sensor': Sending state 4415.98193 litre with 0 decimals of accuracy
[01:43:21][D][sensor.ultrasonic:056]: Distance measurement timed out!

There is already a bug report for this:

I found the same problem, the ultrasonic sensor does not work and the values read remain fixed at 0.1m. The Home Assistant version is 0.90.1, ESPHome 1.12.1.

If you read the issue pointed to by @exxamalte you’ll find a solution.

Added the branch :

esphome:
  name: xyz
  platform: ESP8266
  board: xyz
  esphome_core_version:
    branch: fix-ultrasonic