A Python3 library for Elexa Guardian water valves and sensors
Project description
🚰 aioguardian: A Python3 library for Elexa Guardian devices
aioguardian
is a Python3, asyncio
-focused library for interacting with
the Guardian line of water valves and sensors from Elexa.
Installation
pip install aioguardian
Python Versions
aioguardian
is currently supported on:
- Python 3.6
- Python 3.7
- Python 3.8
Documentation
Complete documentation can be found here: http://aioguardian.readthedocs.io
Usage
import asyncio
from aioguardian import Client
from aioguardian.errors import GuardianError
async with Client("192.168.1.100") as client:
# Run various commands
asyncio.run(main())
If the mood should strike you, you can manually instantiate a Client
object and manage
connection to and disconnection from the device yourself:
import asyncio
from aioguardian import Client
from aioguardian.errors import GuardianError
client = Client("192.168.1.100")
await client.connect()
# Run various commands
# Notice that disconnection is via a regular method, not a coroutine:
client.disconnect()
asyncio.run(main())
Commands
Many commands are available:
client.device.diagnostics()
: return diagnostics info from the deviceclient.device.factory_reset()
: perform a factory reset of the deviceclient.device.ping()
: ping the device to determine whether it can be reachedclient.device.publish_state()
: publish the device state to the Guardian cloudclient.device.reboot()
: reboot the deviceclient.device.upgrade_firmware()
: initiate a firmware upgrade on the deviceclient.device.wifi_configure()
: connect the device to an SSIDclient.device.wifi_disable_ap()
: disable the device's onboard WiFi access pointclient.device.wifi_enable_ap()
: enable the device's onboard WiFi access pointclient.device.wifi_reset()
: reset all WiFi infoclient.device.wifi_status()
: get information related to the device's WiFi connectionsclient.sensor.pair_dump()
: get information on all paired sensorsclient.sensor.pair_sensor()
: pair a new sensor to the deviceclient.sensor.sensor_status()
: get information from the device's onboard sensorsclient.valve.valve_close()
: close the valveclient.valve.valve_halt()
: halt the valve mid-open or mid-close (be careful!)client.valve.valve_open()
: open the valveclient.valve.valve_reset()
: reset all valve diagnosticsclient.valve.valve_status()
: get information about the device's valve
Response payload samples for each of these commands can be found in the
fixtures
folder.
Contributing
- Check for open features/bugs or initiate a discussion on one.
- Fork the repository.
- (optional, but highly recommended) Create a virtual environment:
python3 -m venv .venv
- (optional, but highly recommended) Enter the virtual environment:
source ./.venv/bin/activate
- Install the dev environment:
script/setup
- Code your new feature or bug fix.
- Write tests that cover your new functionality.
- Run tests and ensure 100% code coverage:
script/test
- Update
README.md
with any new documentation. - Add yourself to
AUTHORS.md
. - Submit a pull request!
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
aioguardian-0.1.0.tar.gz
(8.9 kB
view hashes)
Built Distribution
Close
Hashes for aioguardian-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e921d60a134e6e8626bd303e17b7a006068a9704b974cb0441b2eec52937802c |
|
MD5 | 784a1f792c07159e2d33927a4d220b97 |
|
BLAKE2b-256 | 5eb1a5cf5f3835ccfde23b22925ae6aea6d14a0614b20b137cf7acb826ef0b0b |