A Python API for accessing the Shelly devices.
Project description
shelly-cloud
A python library to access the Shelly cloud API. Refer also to the Shelly API Docs. This repo provides functionality for:
- Getting devices status
- Getting the status of a single device
- Getting a list of device IDs
Installing the library locally
Python3 is recommended for this project.
python -m pip install -e .
This is needed for the first time when working with the library/examples/tests.
Example usage
Create a .env
file and set the environment variables according to .env.example
:
cp .env.example .env
Then run the the example script
python examples/simple.py
or
from shellyapi.shellyapi import ShellyApi
shelly = ShellyApi('provide_api_url', 'provide_api_token')
# or you can define additional optional parameters
# shelly = ShellyApi('provide_api_url', 'provide_api_token', timeout=10)
print(shelly.get_device_ids())
Development
Linting
pylint shellyapi/*.py tests/*.py examples/*.py
Unit testing
python -m unittest -v tests/*.py
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
shelly-cloud-0.1.13.tar.gz
(15.4 kB
view hashes)
Built Distribution
Close
Hashes for shelly_cloud-0.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b63e245ee84de20eb56e99594a2795716083b274863e85e93c2df1919fb5e7f |
|
MD5 | cd126d6a4dc8511992e671206d35132b |
|
BLAKE2b-256 | ea6b5c5380513a145429be62f921d66c52c462700e6a75c39049e802517d2875 |