a
    {b                     @   s   d Z G dd dZdS )aV  
Vibrator
=======

The :class:`Vibrator` provides access to public methods to use vibrator of your
device.

.. note::
    On Android your app needs the VIBRATE permission to
    access the vibrator.

Simple Examples
---------------

To vibrate your device::

    >>> from plyer import vibrator
    >>> time=2
    >>> vibrator.vibrate(time=time)

To set a pattern::

    >>> vibrator.pattern(pattern=pattern, repeat=repeat)

To know whether vibrator exists or not::

    >>> vibrator.exists()

To cancel vibration::

    >>> vibrator.cancel()

Supported Platforms
-------------------
Android, iOS


c                   @   sT   e Zd ZdZdddZdddZd	d
 Zdd Zdd Zdd Z	dd Z
dd ZdS )Vibratorz
    Vibration facade.
       c                 C   s   | j |d dS )z
        Ask the vibrator to vibrate for the given period.

        :param time: Time to vibrate for, in seconds. Default is 1.
        )timeN)_vibrate)selfr    r   f/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/plyer/facades/vibrator.pyvibrate.   s    zVibrator.vibrate    r   c                 C   s   | j ||d dS )aj  
        Ask the vibrator to vibrate with the given pattern, with an
        optional repeat.

        :param pattern: Pattern to vibrate with. Should be a list of
            times in seconds. The first number is how long to wait
            before vibrating, and subsequent numbers are times to
            vibrate and not vibrate alternately.
            Defaults to ``[0, 1]``.

        :param repeat: Index at which to repeat the pattern. When the
            vibration pattern reaches this index, it will start again
            from the beginning. Defaults to ``-1``, which means no
            repeat.
        )patternrepeatN)_pattern)r   r   r   r   r   r   r   6   s    zVibrator.patternc                 C   s   |   S )zT
        Check if the device has a vibrator. Returns True or
        False.
        )_existsr   r   r   r   existsH   s    zVibrator.existsc                 C   s   |    dS )zH
        Cancels any current vibration, and stops the vibrator.
        N)_cancelr   r   r   r   cancelO   s    zVibrator.cancelc                 K   s
   t  d S NNotImplementedErrorr   kwargsr   r   r   r   W   s    zVibrator._vibratec                 K   s
   t  d S r   r   r   r   r   r   r   Z   s    zVibrator._patternc                 K   s
   t  d S r   r   r   r   r   r   r   ]   s    zVibrator._existsc                 K   s
   t  d S r   r   r   r   r   r   r   `   s    zVibrator._cancelN)r   )r	   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r   r   r   )   s   

r   N)r   r   r   r   r   r   <module>   s   (