Skip to main content

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


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 details)

Uploaded Source

Built Distribution

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

aiokwikset-0.0.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file aiokwikset-0.0.2.tar.gz.

File metadata

  • Download URL: aiokwikset-0.0.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for aiokwikset-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1bd891764054d08b599f28e2f447126642848f07c16fd5156d73e6e47b252635
MD5 63f0f551dc0eca2708facb3e89dfac0b
BLAKE2b-256 62ae8832fb3ef42d973c55dea2ce8a4f2232d4bd1257a9cae97b47c53eb14c46

See more details on using hashes here.

File details

Details for the file aiokwikset-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aiokwikset-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for aiokwikset-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2cc7d28de91c31eb32449c0c0295fd5c2821c559d9d63700e2dc86b8cc4e25b3
MD5 e36d4584c07737d0042338137cf39e67
BLAKE2b-256 f2bcca13df8e04e3d858b3ea8b544409387e5673eb25b5b7166bb67791db6909

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