[ruff] Enable FURB rules for code modernization (#9896)

This commit is contained in:
J. Nick Koston
2025-07-26 20:54:03 +12:00
committed by GitHub
parent d54db471bd
commit d64e4d3c49
9 changed files with 13 additions and 15 deletions
+2 -4
View File
@@ -27,8 +27,7 @@ SetDecelerationAction = stepper_ns.class_("SetDecelerationAction", automation.Ac
def validate_acceleration(value):
value = cv.string(value)
for suffix in ("steps/s^2", "steps/s*s", "steps/s/s", "steps/ss", "steps/(s*s)"):
if value.endswith(suffix):
value = value[: -len(suffix)]
value = value.removesuffix(suffix)
if value == "inf":
return 1e6
@@ -48,8 +47,7 @@ def validate_acceleration(value):
def validate_speed(value):
value = cv.string(value)
for suffix in ("steps/s", "steps/s"):
if value.endswith(suffix):
value = value[: -len(suffix)]
value = value.removesuffix(suffix)
if value == "inf":
return 1e6