Python interface for Kwikset Halo API
Project description
aiokwikset - Python interface for the Kwikset Halo API
Python library for communicating with the Kwikset Halo Devices via the Kwikset Halo cloud API.
WARNING
- This library only works if you have signed up for and created a home/had a home shared with you from the Kwikset Application.
- IOS
- Android
NOTE:
- This library is community supported, please submit changes and improvements.
- This is a very basic interface, not well thought out at this point, but works for the use cases that initially prompted spitting this out from.
Supports
- locking/unlocking
- retrieving basic information
Installation
pip install aiokwikset
Examples
import asyncio
from aiohttp import ClientSession
from aiokwikset import async_get_api
async def main() -> None:
"""Run!"""
api = await async_get_api("<EMAIL>", "<PASSWORD>")
# Get user account information:
user_info = await api.user.get_info()
# Get home/homes information
homes_info = await api.user.get_homes()
# Get devices information
devices = await api.device.get_devices(homes_info['homeid'])
# Get a device specific information
device_info = await api.device.get_device_info(devices['data'][0]['deviceid'])
# Lock the specific device
lock = await api.device.lock_device(devices['data'][0], user_info)
asyncio.run(main())
By default, the library creates a new connection to Kwikset with each coroutine. If you are calling a large number of coroutines (or merely want to squeeze out every second of runtime savings possible), an aiohttp ClientSession can be used for connection pooling:
import asyncio
from aiohttp import ClientSession
from aiokwikset import async_get_api
async def main() -> None:
"""Create the aiohttp session and run the example."""
async with ClientSession() as websession:
api = await async_get_api("<EMAIL>", "<PASSWORD>", session=websession)
# Get user account information:
user_info = await api.user.get_info()
# Get home/homes information
homes_info = await api.user.get_homes()
# Get devices information
devices = await api.device.get_devices(homes_info['homeid'])
# Get a device specific information
device_info = await api.device.get_device_info(devices['data'][0]['deviceid'])
# Lock the specific device
lock = await api.device.lock_device(devices['data'][0], user_info)
asyncio.run(main())
Known Issues
- not all APIs supported
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
aiokwikset-0.0.2.tar.gz
(18.1 kB
view hashes)
Built Distribution
aiokwikset-0.0.2-py3-none-any.whl
(19.6 kB
view hashes)
Close
Hashes for aiokwikset-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc7d28de91c31eb32449c0c0295fd5c2821c559d9d63700e2dc86b8cc4e25b3 |
|
MD5 | e36d4584c07737d0042338137cf39e67 |
|
BLAKE2b-256 | f2bcca13df8e04e3d858b3ea8b544409387e5673eb25b5b7166bb67791db6909 |