Skip to main content

Python API for Yale Access (formerly August) Smart Lock and Doorbell

Project description

yalexs PyPI version Build Status codecov Python Versions

Python API for Yale Access (formerly August) Smart Lock and Doorbell. This is used in Home Assistant but should be generic enough that can be used elsewhere.

Yale Access formerly August

This library is a fork of Joe Lu's excellent august library from https://github.com/snjoetw/py-august

Classes

Authenticator

Authenticator is responsible for all authentication related logic, this includes authentication and verifying the account belongs to the user by sending a verification code to email or phone.

Constructor

Argument Description
api See Api class.
login_method Login method, either "phone" or "email".
username If you're login_method is phone, then this is your full phone# including "+" and country code; otherwise enter your email address here.
password Password.
install_id* ID that's generated when Yale Access app is installed. If not specified, Authenticator will auto-generate one. If an install_id is provisioned, then it's good to provide the provisioned install_id as you'll bypass verification process.
access_token_cache_file* Path to access_token cache file. If specified, access_token info will be cached in the file. Subsequent authentication will utilize information in the file to determine correct authentication state.

* means optional

Methods

authenticate

Authenticates using specified login_method, username and password.

Outcome of this method is an Authentication object. Use Authentication.state figure out authentication state. User is authenticated only if Authentication.state = AuthenticationState.AUTHENTICATED.

If an authenticated access_token is already in the access_token_cache_file, this method will return cached authentication.

send_verification_code

Sends a 6-digits verification code to phone or email depending on login_method.

validate_verification_code

Validates verification code. This method returns ValidationResult. Check the value to see if verification code is valid or not.

Install

pip install yalexs

Usage

import asyncio
from aiohttp import ClientSession

from yalexs.api_async import ApiAsync
from yalexs.authenticator_async import AuthenticatorAsync
from yalexs.const import Brand
from yalexs.alarm import ArmState


async def main():
    api = ApiAsync(ClientSession(), timeout=20, brand=Brand.YALE_HOME)
    authenticator = AuthenticatorAsync(api, "email", "EMAIL_ADDRESS", "PASSWORD}",
        access_token_cache_file="auth.txt",install_id="UUID")
    await authenticator.async_setup_authentication()
    authentication = await authenticator.async_authenticate()
    access_token = authentication.access_token

    # if(authentication.state == AuthenticationState.REQUIRES_VALIDATION) :
    #   await authenticator.async_send_verification_code()
    # await authenticator.async_validate_verification_code("12345")

    # DO STUFF HERE LIKE GET THE ALARMS, LOCS, ETC....
    alarms = await api.async_get_alarms(access_token)
    locks = api.get_locks(access_token)

    # OR ARM YOUR ALARM
    await api.async_arm_alarm(access_token, alarms[0], ArmState.Away)



asyncio.run(main())

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

yalexs-9.2.1.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

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

yalexs-9.2.1-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file yalexs-9.2.1.tar.gz.

File metadata

  • Download URL: yalexs-9.2.1.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yalexs-9.2.1.tar.gz
Algorithm Hash digest
SHA256 cae1c378336e35f80dbb3c9457c3d1c3760fb35d8431df43c0556a8e954c4ecb
MD5 ce62a0b93319e0bb5be796413d355fad
BLAKE2b-256 3d4f2b6164cf68314c0a9ee4aa4ea5ffeca91d6781457b5537587afce0977a29

See more details on using hashes here.

Provenance

The following attestation bundles were made for yalexs-9.2.1.tar.gz:

Publisher: ci.yml on Yale-Libs/yalexs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yalexs-9.2.1-py3-none-any.whl.

File metadata

  • Download URL: yalexs-9.2.1-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yalexs-9.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 870a949ef54f4b467815d63fc13897d33dd3e21a3f39652847b35f8cb9e30292
MD5 7d59a4519b13546dca2a90be6a5df475
BLAKE2b-256 1187e9b645b8a9bdd4d21b3ebe27d77e9af2c7a2f7139b02ed7c3a1a22c829c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for yalexs-9.2.1-py3-none-any.whl:

Publisher: ci.yml on Yale-Libs/yalexs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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