From 13d470a3bce218175a43874efede896a33c2e29b Mon Sep 17 00:00:00 2001 From: Christ van Willegen Date: Fri, 24 May 2024 13:16:43 +0200 Subject: [PATCH] Fix linter feedback. --- esphome/components/stepper/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/esphome/components/stepper/__init__.py b/esphome/components/stepper/__init__.py index d1a3bf2be5..243d7ebe2f 100644 --- a/esphome/components/stepper/__init__.py +++ b/esphome/components/stepper/__init__.py @@ -71,16 +71,18 @@ def validate_speed(value): def validate_rotation(value): value = cv.string(value) - if value == "both": + if value in ("both"): return 0 - if value == "cw" or value == "clockwise": + if value in ("cw", "clockwise"): return 1 - if value == "ccw" or value == "counterclockwise" or value == "counter-clockwise": + if value in ("ccw", "counterclockwise", "counter-clockwise"): return -1 - raise cv.Invalid(f"Expected rotation as 'both', 'cw', 'ccw', 'clockwise', 'counterclockwise', 'counter-clockwise', got {value}") + raise cv.Invalid( + f"Expected rotation as 'both', 'cw', 'ccw', 'clockwise', 'counterclockwise', 'counter-clockwise', got {value}" + ) STEPPER_SCHEMA = cv.Schema(