mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 19:54:14 +01:00
Fix linter feedback.
This commit is contained in:
parent
2d9d207848
commit
13d470a3bc
1 changed files with 6 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue