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
Python 3 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
SHELLY_API_URL="https://HOST:PORT" SHELLY_API_TOKEN="REPLACE_ME" python3 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
Installing required pip packages
python pip install -r requirenments.txt
pre-commit install -t pre-push
Linting
pylint shellyapi/*.py tests/*.py examples/*.py
Unit testing
pytest tests/*.py
# show logs
pytest -o log_cli=true
# code coverage
pytest --durations=10 --cov-report term-missing --cov=shellyapi tests
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.14.tar.gz
(16.5 kB
view hashes)
Built Distribution
Close
Hashes for shelly_cloud-0.1.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac409b3aeeaf6150ead1aa0ebe2eb27b40e83b7c0ad0c6e5bbd9e41a587c7018 |
|
MD5 | 3c86f2441d8015005285fe0bb98e1ab1 |
|
BLAKE2b-256 | 6715696ecd825ac98075a6aa654e245aed6086912120325f88d7dfd48438d5c8 |