Metadata-Version: 2.4
Name: ufanet_intercom_api
Version: 0.0.9
Summary: API wrapper for managing the Ufanet intercom.
Author-email: regenara <jakebv.22@gmail.com>
License: MIT License
        
        Copyright (c) 2024 regenara
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: repository, https://github.com/regenara/ufanet_intercom_api
Project-URL: homepage, https://github.com/regenara/ufanet_intercom_api
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certifi>=2022.0.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: aiohttp<4.0.0,>=3.0.0
Dynamic: license-file

# Ufanet Intercom API

### Описание / Description
[Обёртка API](https://pypi.org/project/ufanet-intercom-api/) для управления домофоном провайдера **Уфанет**.
<br>[A wrapper](https://pypi.org/project/ufanet-intercom-api/) for the **Ufanet** intercom system API.

## Установка / Installation
```bash
pip install ufanet-intercom-api
```
## Использование / Usage
```python
import asyncio

from ufanet_intercom_api import UfanetIntercomAPI

CONTRACT = 'your_contract'
PASSWORD = 'your_password'

async def main():
    ufanet_api = UfanetIntercomAPI(contract=CONTRACT, password=PASSWORD)

    # Получение списка домофонов / Fetching available intercoms
    intercoms = await ufanet_api.get_intercoms()
    print('Available intercoms:', intercoms)

    # Открытие всех доступных домофонов / Unlocking all available intercoms
    for i in intercoms:
        await ufanet_api.open_intercom(intercom_id=i.id)

    # Получение истории вызовов / Retrieving call history
    call_history = await ufanet_api.get_call_history()
    for call in call_history.results:
        print(f'Call UUID: {call.uuid}, Date: {call.called_at}')

    # Получение ссылок на записи вызовов / Fetching call recording links
    if call_history.results:
        links = await ufanet_api.get_call_history_links(uuid=call_history.results[0].uuid)
        print('Call history links:', links)
    
    # Закрытие сессии / Closing the session
    await ufanet_api.close() 

asyncio.run(main())

```
