Skip to main content

A Python3 library for Elexa Guardian water valves and sensors

Project description

🚰 aioguardian: A Python3 library for Elexa Guardian devices

CI PyPi Version License Code Coverage Maintainability Say Thanks

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 device
  • client.device.factory_reset(): perform a factory reset of the device
  • client.device.ping(): ping the device to determine whether it can be reached
  • client.device.publish_state(): publish the device state to the Guardian cloud
  • client.device.reboot(): reboot the device
  • client.device.upgrade_firmware(): initiate a firmware upgrade on the device
  • client.device.wifi_configure(): connect the device to an SSID
  • client.device.wifi_disable_ap(): disable the device's onboard WiFi access point
  • client.device.wifi_enable_ap(): enable the device's onboard WiFi access point
  • client.device.wifi_reset(): reset all WiFi info
  • client.device.wifi_status(): get information related to the device's WiFi connections
  • client.sensor.pair_dump(): get information on all paired sensors
  • client.sensor.pair_sensor(): pair a new sensor to the device
  • client.sensor.sensor_status(): get information from the device's onboard sensors
  • client.valve.valve_close(): close the valve
  • client.valve.valve_halt(): halt the valve mid-open or mid-close (be careful!)
  • client.valve.valve_open(): open the valve
  • client.valve.valve_reset(): reset all valve diagnostics
  • client.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

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. (optional, but highly recommended) Create a virtual environment: python3 -m venv .venv
  4. (optional, but highly recommended) Enter the virtual environment: source ./.venv/bin/activate
  5. Install the dev environment: script/setup
  6. Code your new feature or bug fix.
  7. Write tests that cover your new functionality.
  8. Run tests and ensure 100% code coverage: script/test
  9. Update README.md with any new documentation.
  10. Add yourself to AUTHORS.md.
  11. Submit a pull request!

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

aioguardian-0.1.0.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

aioguardian-0.1.0-py3-none-any.whl (9.7 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