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

There exists a cli and programming interface to interact with the yale apis.

Supported functions:

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

Python version

Tested with the following python versions

  • Python 3.7
  • Python 3.6

CLI

The cli can be used as a standalone python program. Just instsall the client as you usually would by doing a pip install:

pip install yaleclient

The cli optionally reads these variables from envrionment, so you do not have to specify them as arguments.

  • YALE_USERNAME
  • YALE_PASSWORD
  • LOCK_PIN_CODE

Usage

> export YALE_USERNAME=foo
> export YALE_PASSWORD=bar
> export LOCK_PIN_CODE=123456

> yaleclient --api=LOCK --operation=STATUS --lock_id=mydoor
mydoor [YaleLockState.LOCKED]

> yaleclient --api=LOCK --operation=STATUS
mydoor [YaleLockState.LOCKED]
mydoor2 [YaleLockState.LOCKED]

> yaleclient --api=LOCK --operation=OPEN
mydoor [YaleLockState.OPEN]
mydoor2 [YaleLockState.OPEN]

> yaleclient --api=LOCK --operation=CLOSE
mydoor [YaleLockState.LOCKED]
mydoor2 [YaleLockState.LOCKED]

> yaleclient --api=LOCK --help
> yaleclient --api=ALARM --help

Programming api

Usage

Create a client with:

from yaleclient import YaleClient
client = YaleClient(username="", password="")

where username and password are your Yale credentials.

Locks

Iterate the connected locks

for lock in client.lock_api.locks():
    print(lock)

lock a single lock

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

unlock:

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

Alarm

Change the alarm state with:

client.alarm_api.arm_full()
client.alarm_api.arm_partial()
client.alarm_api.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_api.is_armed() # == True

or return alarm status. eg.

client.alarm_api.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.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distributions

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

yaleclient-0.2.2-py3.7.egg (17.1 kB view details)

Uploaded Egg

yaleclient-0.2.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file yaleclient-0.2.2.tar.gz.

File metadata

  • Download URL: yaleclient-0.2.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for yaleclient-0.2.2.tar.gz
Algorithm Hash digest
SHA256 adc83af11e85bcfdad5b447d272409c62234d27c5acbc80656524b661952326b
MD5 3a171c60279b523000056a223fb8864c
BLAKE2b-256 924a2c5564e221331ea154312755ee04617b78538742d25f3107f4db07040e0f

See more details on using hashes here.

File details

Details for the file yaleclient-0.2.2-py3.7.egg.

File metadata

  • Download URL: yaleclient-0.2.2-py3.7.egg
  • Upload date:
  • Size: 17.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for yaleclient-0.2.2-py3.7.egg
Algorithm Hash digest
SHA256 4684d64c31b72bf4831b990e79efd6f0d0c1e9a2219ea3c9829946a05cac31a6
MD5 0dbfdaf7dc2ad045846828792078cdf3
BLAKE2b-256 29190735f7417043d3c13a1e115ccfbcc6ae1a4b21cb986c2b44384215760aa3

See more details on using hashes here.

File details

Details for the file yaleclient-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: yaleclient-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for yaleclient-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5be155b11a651f2d9369a031bbf1b20b79da17bd8fe5d54d87635146929bc6df
MD5 ad4017f1a1b158114898e561061c8a69
BLAKE2b-256 42274c5342a4ff14ba8e12b6ada0f4bbd9db0f249cf3c7440d0d00fe01c653cb

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