已知函数 $f\left(x\right) = x - 1 + \dfrac{a}{{{{\mathrm{e}}^x}}}$,($a \in {\mathbb{R}}$,${\mathrm{e}}$ 为自然对数的底数).
1、若曲线 $y = f\left(x\right)$ 在点 $\left(1,f\left(1\right)\right)$ 处的切线平行于 $x$ 轴,求 $a$ 的值.
2、求函数 $f\left(x\right)$ 的极值.
3、当 $a = 1$ 时,若直线 $l:y = kx - 1$ 与曲线 $y = f\left(x\right)$ 没有公共点,求 $k$ 的最大值.
