Skip to main content

Library for controlling smart bulbs that are controlled by the DoIT protocol

Project description

DoHome API

Library for controlling smart bulbs that work using the DoIT protocol (DoHome app).

Installation

pip install dohome-api

Usage

Find the light bulbs that are on

from dohome_api import DoHomeGateway
from asyncio import run

async def main():
    gateway = DoHomeGateway()
    descriptions = await gateway.discover_lights()
    for description in descriptions:
        print(f"Found light: sid {descr['sid']}, ip {descr['sta_ip']}")

run(main())

Change the color of the light bulb

from dohome_api import DoHomeGateway
from asyncio import run

async def main():
    gateway = DoHomeGateway()
    light = await gateway.add_light("19eb") # last 4 symbols of mac address
    await light.set_rgb(255, 0, 0) # red

run(main())

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

dohome_api-0.0.3.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

dohome_api-0.0.3-py3-none-any.whl (11.0 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