Skip to main content

Asynchronous library to control Shelly devices.

Project description

Aioshelly

Asynchronous library to control Shelly

This library is under development.

Requires Python 3 and uses asyncio, aiohttp and aiocoap.

import asyncio
from pprint import pprint
import aiocoap
import aiohttp
import aioshelly

async def main():
    options = aioshelly.ConnectionOptions("192.168.1.165", "username", "password")

    coap_context = await aiocoap.Context.create_client_context()

    async with aiohttp.ClientSession() as session:
        device = await aioshelly.Device.create(session, options)

        for block in device.blocks:
            print(block)
            pprint(block.current_values())
            print()

    await coap_context.shutdown()


if __name__ == "__main__":
    asyncio.run(main())

Breaking changes for 0.3.3+

Due to the code quality checks, we changed a few methods/properties:

  • ip() is now ip_address()
  • d is now coap_d
  • s is now coap_s

Contribution guidelines

Object hierarchy and property/method names should match the Shelly API.

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

aioshelly-0.4.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

aioshelly-0.4.0-py3-none-any.whl (9.5 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