code: def _wait(self, duration, steps, commands):
          
          wait = ((duration - self.wait * self.reps * commands) / steps) - \
                 (self.wait * self.reps * self._bridge.active)
          return max(0, wait)
docs: Compute wait time.
  
          :param duration: Total time (in seconds).
          :param steps: Number of steps.
          :param commands: Number of commands.
          :returns: Wait in seconds.