From 06c0b32cead5441bd59ea48e906280ee908f791e Mon Sep 17 00:00:00 2001 From: Masterz69 Date: Tue, 2 Apr 2024 19:39:32 +0300 Subject: [PATCH] Update sensor.py --- esphome/components/ultrasonic_uart/sensor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)