Communicate with Hikvision smart doorbells via Hik-Connect cloud.
Project description
Usage
from hikconnect.api import HikConnect
async with HikConnect() as api:
await api.login("foo", "bar")
devices = [device async for device in api.get_devices()]
print(devices)
# [{
# 'id': 'DS-XXXXXX-YYYYYYYYYYYYYYYYYYYYYYYYY',
# 'name': 'DS-XXXXXX-Y(ZZZZZZZZZ)',
# 'serial': 'ZZZZZZZZZ',
# 'type': 'DS-XXXXXX-Y',
# 'version': 'V1.2.3 build 123456',
# 'locks': {1: 2, 2: 0, 3: 1}
# }]
# locks data means (guessing): <channel number>: <number of locks connected>
my_device_serial = devices[0]["serial"]
cameras = [camera async for camera in api.get_cameras(my_device_serial)]
print(cameras)
# [
# {'id': '4203fd7c5f89ce96f8ff0adfdbe8b731', 'name': 'foo', 'channel_number': 1, 'signal_status': 1, 'is_shown': 0},
# {'id': 'cd72bc923956952194468738123b7a5e', 'name': 'bar', 'channel_number': 2, 'signal_status': 1, 'is_shown': 1},
# {'id': 'd2a2057d853438d9a5b4954baec136e3', 'name': 'baz', 'channel_number': 3, 'signal_status': 0, 'is_shown': 0}
# ]
call_status = await api.get_call_status(my_device_serial)
print(call_status)
# {"apiId":1,"callStatus":1,"verFlag":1,"callerInfo":{"buildingNo":0,"floorNo":0,"zoneNo":0,"unitNo":0,"devNo":0,"devType":0,"lockNum":0},"rc":1}
await api.unlock(my_device_serial, 1)
# call this periodically at least once per 30 mins!
if api.is_refresh_login_needed():
await api.refresh_login()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hikconnect-0.7.2.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for hikconnect-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ec460771dc418d625d71ba0fd25a98a74e0161e9c454bc430e68bef2e63c8e |
|
MD5 | fa868e19b93434ff7032250057a4426e |
|
BLAKE2b-256 | 5aaa35d270f530d7832c24080c7d30f42e5dcc365f2718cde1c19f6c87068c2b |