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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file domru_intercom_api-1.1.4.tar.gz.
File metadata
- Download URL: domru_intercom_api-1.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
260c2003ee1608c7049a7ff461713579e836da53625986421d957ebe653dac20
|
|
| MD5 |
ef65032df458cf5ffd5eabe66242cfc4
|
|
| BLAKE2b-256 |
0fb2ee388471bccb41a4d7c69e396d5b4a2c7326ecc26568527d4ec1cf6a528f
|
File details
Details for the file domru_intercom_api-1.1.4-py3-none-any.whl.
File metadata
- Download URL: domru_intercom_api-1.1.4-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8401e54492272c0500aad267b57ea22446989beda9b33ea25f695314ce29d955
|
|
| MD5 |
12cec99a15e1db82c546856b89282661
|
|
| BLAKE2b-256 |
63293e1f79fa2002505a6773848d18c3102f4eb434f144830a506f5e1263676c
|