a
    ýÞ{b÷	  ã                   @   s   d Z G dd„ dƒZdS )aâ  
IrBlaster
============

The :class:`IrBlaster` provides access to public methods by which your device
can act as a remote and could be used to control your TV, AC, Music Player,
Projectors, Set top box or anything that can be controlled by a remote.

.. note::
    - On Android your app needs the TRANSMIT_IR permission which allows an
    application to use the device's IR transmitter, If available.

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

To get transmit an IR sequence::

    >>> from plyer import irblaster
    >>> irblaster.transmit(frequency, pattern, mode)

To get frequencies::

    >>> irblaster.frequencies

To check if IrBlaster exists::

    >>> irblaster.exists()
    True/False

Supported Platforms
-------------------
Android

c                   @   sf   e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZdd	„ Z	ddd„Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )Ú	IrBlasterz"
    Infrared blaster facade.
    c                    s   d|  ‰ ‡ fdd„|D ƒS )zG
        Convert a pattern from period counts to microseconds.
        ç    €„.Ac                    s   g | ]}ˆ | ‘qS © r   ©Ú.0Úx©Úperiodr   úg/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/plyer/facades/irblaster.pyÚ
<listcomp>0   ó    z5IrBlaster.periods_to_microseconds.<locals>.<listcomp>r   ©Ú	frequencyÚpatternr   r   r	   Úperiods_to_microseconds*   s    z!IrBlaster.periods_to_microsecondsc                    s   d|  ‰ ‡ fdd„|D ƒS )zG
        Convert a pattern from microseconds to period counts.
        r   c                    s   g | ]}|ˆ  ‘qS r   r   r   r   r   r	   r
   8   r   z5IrBlaster.microseconds_to_periods.<locals>.<listcomp>r   r   r   r   r	   Úmicroseconds_to_periods2   s    z!IrBlaster.microseconds_to_periodsc                 C   s   |   ¡ S )zÓ
        Property which contains a list of frequency ranges
           supported by the device in the form:

           [(from1, to1),
            (from2, to2),
            ...
            (fromN, toN)]
        )Úget_frequencies©Úselfr   r   r	   Úfrequencies:   s    zIrBlaster.frequenciesc                 C   s   |   ¡ S ©N)Ú_get_frequenciesr   r   r   r	   r   G   s    zIrBlaster.get_frequenciesr   c                 C   s   |   |||¡S )a†  
        Transmit an IR sequence.

        :parameters:
            `frequency`: int
                Carrier frequency for the IR transmission.
            `pattern`: list[int]
                Burst pair pattern to transmit.
            `mode`: str, defaults to 'period'
                Specifies the format of the pattern values.
                Can be 'period' or 'microseconds'.
        )Ú	_transmit©r   r   r   Úmoder   r   r	   ÚtransmitJ   s    zIrBlaster.transmitc                 C   s   |   ¡ S )z>
        Check if the device has an infrared emitter.
        )Ú_existsr   r   r   r	   ÚexistsY   s    zIrBlaster.existsc                 C   s
   t ƒ ‚d S r   ©ÚNotImplementedErrorr   r   r   r	   r   a   s    zIrBlaster._get_frequenciesc                 C   s
   t ƒ ‚d S r   r   r   r   r   r	   r   d   s    zIrBlaster._transmitc                 C   s
   t ƒ ‚d S r   r   r   r   r   r	   r   g   s    zIrBlaster._existsN)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r   Úpropertyr   r   r   r   r   r   r   r   r   r   r	   r   %   s   



r   N)r"   r   r   r   r   r	   Ú<module>   s   $