Skip to main content

Python module to talk to Philips Hue.

Project description

Aioshelly

Asynchronous library to control Shelly

This library is under development.

Requires Python 3.5 and uses asyncio, aiohttp and aiocoap.

import asyncio
from pprint import pprint
import aiohttp
import aioshelly

async def main():
    async with aiohttp.ClientSession() as session:
        device = await aioshelly.Device.create("192.168.1.165", session)

        # pprint(device.d)
        # pprint(device.s)

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

        print(await device.blocks[0].toggle())

        await device.shutdown()


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

Contribution guidelines

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page