diff --git a/esphome/components/ultrasonic_uart/sensor.py b/esphome/components/ultrasonic_uart/sensor.py index ed77cac3ab..9280f58ed3 100644 --- a/esphome/components/ultrasonic_uart/sensor.py +++ b/esphome/components/ultrasonic_uart/sensor.py @@ -11,7 +11,10 @@ DEPENDENCIES = ["uart"] ultrasonic_uart_ns = cg.esphome_ns.namespace("ultrasonic_uart") UltrasonicSensorComponent_UART = ultrasonic_uart_ns.class_( - "UltrasonicSensorComponent_UART", sensor.Sensor, cg.PollingComponent, uart.UARTDevice, + "UltrasonicSensorComponent_UART", + sensor.Sensor, + cg.PollingComponent, + uart.UARTDevice, ) CONFIG_SCHEMA = ( @@ -36,6 +39,7 @@ FINAL_VALIDATE_SCHEMA = uart.final_validate_device_schema( stop_bits=1, ) + async def to_code(config): var = await sensor.new_sensor(config) await cg.register_component(var, config)