Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.44 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.44 KB

aionuki

PyPI PyPI - Downloads PyPI - License Python Lint

Asynchronous Python library for interacting with Nuki locks and openers. Forked from pynuki. Refactored to use aiohttp and asyncio.

Supports automatic bridge discovery using nuki.io servers and interactive authentication without manually entering any token.

Supports parsing callbacks and integrating the result in the object's data structure. Full support of the Nuki API Spec v1.12 PDF Here

Installation

pip install -U aionuki

Usage

import asyncio
from aionuki import NukiBridge

async def main():
    bridges = await NukiBridge.discover()

    async with (bridges[0])(token=None) as br:
        print("Starting the interactive auth procedure.", br)

        if not br.token:
            print("Received token:", await br.auth())

        await br.connect()

        lock = (await br.locks)[0]

        await lock.lock()
        await lock.unlock()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

More info in the examples directory.