def _set_duration(self, duration):
        """
        Sets the object's `duration` property. If `duration` is
        passed, sets it to the *int* of that value, otherwise sets it to its
        configured default value and provides the means to change the value
        using the up/down buttons and the LCD.
        """

        if duration is not None:
            self.duration = int(duration)
        else:
            self.duration = int(self.DEFAULT_DURATION)
            self.write("Set")
            self.write("timer", 2)
            sleep(1)

            self.write("Timer:")
            self.write("%2d mins" % self.duration, 2)

            self._setup_up_down_buttons(
                self.increase_duration,
                self.decrease_duration
            )