Skip to main content

API wrapper for managing the dom.ru intercom.

Project description

Domru Intercom API

Описание / Description

Обёртка API для управления домофоном провайдера Дом.ру.
A wrapper for the Dom.ru intercom system API.

Установка / Installation

pip install domru-intercom-api

Использование / Usage

import asyncio

from domru_intercom_api import DomruIntercomAPI

LOGIN = 'your_login'
PASSWORD = 'your_password'
REFRESH_TOKEN = 'your_refresh_token'
OPERATOR_ID = 13

async def main():
    domru_api = DomruIntercomAPI(login=LOGIN, password=PASSWORD)
    print(domru_api.refresh_data) # save refresh data
    # OR
    domru_api = DomruIntercomAPI(refresh_token=REFRESH_TOKEN, operator_id=OPERATOR_ID)

    # Получение списка мест / Get subscriber places
    places = await domru_api.get_subscriber_places()
    place_id = places[0].place.id
    devices = await domru_api.get_devices(place_id=place_id)

    # Открытие всех доступных домофонов / Unlocking all available intercoms
    for device in devices:
        await domru_api.open_intercom(place_id=place_id, device_id=device.id)
    
    # Получение временных кодов / Get temporal codes
    temporal_codes = await domru_api.get_temporal_codes(*[device.id for device in devices])
    print(temporal_codes)
    
    # Получение истории событий / Retrieving event history
    events = await domru_api.get_events(place_id, page=0, sort='ASC')
    for event in events:
        print(event.message)

    # Закрытие сессии / Closing the session
    await domru_api.close() 

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

domru_intercom_api-1.1.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

domru_intercom_api-1.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file domru_intercom_api-1.1.2.tar.gz.

File metadata

  • Download URL: domru_intercom_api-1.1.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for domru_intercom_api-1.1.2.tar.gz
Algorithm Hash digest
SHA256 da5bbf1b0a31bc601bda1ffda8cac3e71833462719dbc52c4078470bfad0c07c
MD5 81cc615f416909af817a5e4a6472b422
BLAKE2b-256 ac603b2e5c6e97d5f3b376a52a3c42ee7aa4facfb54b0e1d8405a7cb2132fdd0

See more details on using hashes here.

File details

Details for the file domru_intercom_api-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for domru_intercom_api-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cae765dd0f02f392185f57889a3104691ab89a5ef9ea936cf7a8cdaa95895d9
MD5 ff2402a2ee6bbfa808c4eb4824061aca
BLAKE2b-256 85811e3657e56b2d2135dc5589b98a861458a367759d8dc7dcd2cc7fed3f9592

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page