Skip to main content

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

Release files for shelly-cloud 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shelly-cloud 0.2.0
File Size Uploaded
shelly-cloud-0.2.0.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shelly-cloud 0.2.0
File Interpreter ABI Platform
shelly_cloud-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / shelly-cloud-0.2.0.tar.gz

Download URL shelly-cloud-0.2.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eea9e2dcdf358dcc43dbed80ed5ef72c2170da357570ab9537aa70fc0173215e
BLAKE2b-256 checksum
How to use checksums
df41054f8df8d2b2b2fda1c7e92ee53245f65823a740d75716c3552a96aa7694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / shelly_cloud-0.2.0-py3-none-any.whl

Download URL shelly_cloud-0.2.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8346e787ecc686727467b0c192b2cc1cd7ac6e521016715ec39be40bdcf1ba0a
BLAKE2b-256 checksum
How to use checksums
7aa7489233038d06785c30b522fc339b9729ccb3d9806d3d3dea36f264bc08ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.13

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page