def METHOD_NAME(value):
    value = cv.string(value)
    for suffix in ("steps/s", "steps/s"):
        if value.endswith(suffix):
            value = value[: -len(suffix)]
    if value == "inf":
        return 1e6
    try:
        value = float(value)
    except ValueError:
        # pylint: disable=raise-missing-from
        raise cv.Invalid(f"Expected speed as floating point number, got {value}")
    if value <= 0:
        raise cv.Invalid("Speed must be larger than 0 steps/s!")
    return value