mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
Fix linter feedback.
This commit is contained in:
parent
2d9d207848
commit
13d470a3bc
@ -71,16 +71,18 @@ def validate_speed(value):
|
|||||||
def validate_rotation(value):
|
def validate_rotation(value):
|
||||||
value = cv.string(value)
|
value = cv.string(value)
|
||||||
|
|
||||||
if value == "both":
|
if value in ("both"):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if value == "cw" or value == "clockwise":
|
if value in ("cw", "clockwise"):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if value == "ccw" or value == "counterclockwise" or value == "counter-clockwise":
|
if value in ("ccw", "counterclockwise", "counter-clockwise"):
|
||||||
return -1
|
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(
|
STEPPER_SCHEMA = cv.Schema(
|
||||||
|
Loading…
Reference in New Issue
Block a user