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'
ACCESS_TOKEN = 'your_access_token'

async def main():
    domru_api = DomruIntercomAPI(login=LOGIN, password=PASSWORD)
    print(domru_api.access_token) # save access token
    # OR
    domru_api = DomruIntercomAPI(access_token=ACCESS_TOKEN)

    # Получение списка мест / 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)

    # Получение истории событий / 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-0.0.3.tar.gz (7.6 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-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for domru_intercom_api-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5c1763ce65c4201b4c8c9457ee15cc5f58aa6b22ff66e3c54b1f53ad01a0f082
MD5 7167e8fc210cd68f7ff9f0ea0f20ac70
BLAKE2b-256 121c462e7fbb7cb1414b30367cc877ce92b8fefcd2198a00bc9b96d412b2b036

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for domru_intercom_api-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9dfec771cc931645fa09b3a40e5de3e8b4a469ba367b1405b1391b787e379c0
MD5 658f261a3c2b59f10ed66faed4dacc8b
BLAKE2b-256 1d62346da30eb55581552ba95c0e7989f9324334e47be409801310c8e9630f16

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