From dde08b7eee46e3870888fe860dd896d5ee8c13d5 Mon Sep 17 00:00:00 2001 From: CptSkippy Date: Mon, 27 May 2024 00:11:44 -0700 Subject: [PATCH] Fixing flake8 suggestions --- esphome/components/ld2415h/__init__.py | 3 ++- esphome/components/ld2415h/number/__init__.py | 12 ++++++------ esphome/components/ld2415h/sensor/__init__.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/esphome/components/ld2415h/__init__.py b/esphome/components/ld2415h/__init__.py index eee632b903..290e4c7bcb 100644 --- a/esphome/components/ld2415h/__init__.py +++ b/esphome/components/ld2415h/__init__.py @@ -18,7 +18,7 @@ CONFIG_SCHEMA = ( cv.Schema( { cv.GenerateID(): cv.declare_id(LD2415HComponent), - } + } ) .extend(uart.UART_DEVICE_SCHEMA) .extend(cv.COMPONENT_SCHEMA) @@ -32,6 +32,7 @@ FINAL_VALIDATE_SCHEMA = uart.final_validate_device_schema( stop_bits=1, ) + async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) diff --git a/esphome/components/ld2415h/number/__init__.py b/esphome/components/ld2415h/number/__init__.py index 39d16e7518..6f56889d48 100644 --- a/esphome/components/ld2415h/number/__init__.py +++ b/esphome/components/ld2415h/number/__init__.py @@ -23,12 +23,12 @@ CONF_VIBRATION_CORRECTION = "vibration_correction" CONF_RELAY_TRIGGER_DURATION = "relay_trigger_duration" CONF_RELAY_TRIGGER_SPEED = "relay_trigger_speed" -MinSpeedThresholdNumber = ld2415h_ns.class_("MinSpeedThresholdNumber" , number.Number) -CompensationAngleNumber = ld2415h_ns.class_("CompensationAngleNumber" , number.Number) -SensitivityNumber = ld2415h_ns.class_("SensitivityNumber" , number.Number) -VibrationCorrectionNumber = ld2415h_ns.class_("VibrationCorrectionNumber" , number.Number) +MinSpeedThresholdNumber = ld2415h_ns.class_("MinSpeedThresholdNumber" , number.Number) +CompensationAngleNumber = ld2415h_ns.class_("CompensationAngleNumber" , number.Number) +SensitivityNumber = ld2415h_ns.class_("SensitivityNumber" , number.Number) +VibrationCorrectionNumber = ld2415h_ns.class_("VibrationCorrectionNumber" , number.Number) RelayTriggerDurationNumber = ld2415h_ns.class_("RelayTriggerDurationNumber", number.Number) -RelayTriggerSpeedNumber = ld2415h_ns.class_("RelayTriggerSpeedNumber" , number.Number) +RelayTriggerSpeedNumber = ld2415h_ns.class_("RelayTriggerSpeedNumber" , number.Number) CONFIG_SCHEMA = { cv.GenerateID(CONF_LD2415H_ID): cv.use_id(LD2415HComponent), @@ -126,4 +126,4 @@ async def to_code(config): step=1, ) await cg.register_parented(num, config[CONF_LD2415H_ID]) - cg.add(ld2415h_component.set_relay_trigger_speed_number(num)) \ No newline at end of file + cg.add(ld2415h_component.set_relay_trigger_speed_number(num)) diff --git a/esphome/components/ld2415h/sensor/__init__.py b/esphome/components/ld2415h/sensor/__init__.py index 9c23be2578..ba6f0c9e3b 100644 --- a/esphome/components/ld2415h/sensor/__init__.py +++ b/esphome/components/ld2415h/sensor/__init__.py @@ -4,7 +4,7 @@ from esphome.components import sensor from esphome.const import ( CONF_ID, CONF_SPEED, - DEVICE_CLASS_SPEED, + DEVICE_CLASS_SPEED, STATE_CLASS_MEASUREMENT, UNIT_KILOMETER_PER_HOUR, )