Skip to main content

Interact with Yale systems

Project description

Yale Client

Yale client is a python client for interacting with the Yale APIs.

This project is largely taken from https://github.com/domwillcode/yale-smart-alarm-client

The API has been split into alarm and lock, and the auth parts has been moved away into a separate class to keep things noise free.

The codebase has also been updated be more python3 ish, dropping the ancient string formats etc.

Supported functions:

  • alarm api:
    • Arm full (away)
    • Arm partial (away/night)
    • Disarm
    • Get alarm status
  • lock api
    • get status
    • lock
    • unlock

Usage

Create a client with:

client = YaleClient(username, password)

where username and password are your Yale Smart Alarm credentials.

Locks

Iterate the connected locks

client = YaleClient(username, password)
for lock in client.lock.locks():
    print(f"{lock}")

lock a single lock

lock = client.lock.get(name="myfrontdoor"):
lock.close()

unlock:

lock = client.lock.get(name="myfrontdoor"):
lock.open(pin_code="1234566")

Alarm

Change the alarm state with:

client.alarm.arm_full()
client.alarm.arm_partial()
client.alarm.disarm()

or

client.alarm.set_alarm_state(<mode>)

where 'mode' is one of:

from yaleclient.alarm import (YALE_STATE_ARM_PARTIAL,
                              YALE_STATE_DISARM,
                              YALE_STATE_ARM_FULL)

Is the alarm armed fully or partially:

client.alarm.is_armed() # == True

or return alarm status. eg.

client.alarm.get_armed_status() is YALE_STATE_ARM_FULL

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

yaleclient-0.2.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

yaleclient-0.2.0-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page