Python API for Ayla IoT products
Project description
ayla-iot-unofficial
An unofficial python library for interacting with the Ayla IoT API. Intended to be generic for multi-device use.
Designed primarily to be a support package for Home Assistant integrations.
This library is heavily based off of sharkiq by @JeffResc.
Installation
From PyPi
pip install ayla-iot-unofficial
Build from source
pip install build
pip build
pip install ayla-iot-unofficial
Library Requirements
Requires typical http interaction and datatype packages like requests, aiohttp, ujson
User Requirements
Reqiures a username and password (typically a smart device's app login credentials) Requires an app_id and app_secret (granted by Ayla to the smart device's app for operation/integration)
The app_id and app_secret may need to be obtained from proxy traffic or other method.
Usage
Class Object
Instantiate a new class object through new_ayla_api() or Ayla() directly.
For devices that may be region specific, the new_ayla_api() function will create an Ayla() object based on the europe boolean.
Ayla Access_Token
Standard use should call sign_in() on the Ayla object after creation. This will perform the POST login request to obtain an access_token.
Some devices communicate with a different IoT domain but still expose the Ayla access_token. This access token can be passed into the Ayla object using _set_credentials() and the proper arguments.
Devices
By default, calling get_devices() will return a list of class specific device objects with updated properties for use.
See device.py for implemented device classes.
Typical Operation
python3 -m pip install ayla-iot-unofficial
import ayla_iot_unofficial
USERNAME = 'me@email.com'
PASSWORD = '$7r0nkP@s$w0rD'
ayla_api = new_ayla_api(USERNAME, PASSWORD, APP_ID, APP_SECRET)
ayla_api.sign_in()
devices = ayla_api.get_devices()
# Example Vacuum Devices
shark = devices[0]
shark.set_operating_mode(OperatingModes.START)
shark.return_to_base()
# Example Water Softener Devices
softener = devices[1]
softener.capacity_remaining_gallons
softener.set_vacation_mode()
License
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
Built Distribution
Hashes for ayla_iot_unofficial-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c481de3881f4d35918aa827a6b7938035dcb078de877ae269e6a4fbadc7f25e0 |
|
MD5 | 7b94837e47130d0fe92c86af2322afba |
|
BLAKE2b-256 | 2dbbd3f0110b3e5be456dadb3f7b351773c280be94fe07f44f20be67eec6298d |
Hashes for ayla_iot_unofficial-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7101d68dabb40c8161fe3deaa4b590fd0a6fccf5ce0c041baeabeaa944e1a31b |
|
MD5 | be932f0d9391671e86c6a4139b259fcc |
|
BLAKE2b-256 | 01143b91e62a8ea34b1b75688c78dcf17d34038eeac8ef32ff440cec5231b377 |