Skip to main content

An API to communicate with the wiz lights

Project description

Wizpy

Install

pip install wizpy

How to use

Example:

import asyncio
from time import sleep

from wizPy import discover
from wizPy.light import Light


async def main():
    for ip in await discover.discover():
        light: Light = Light(ip)
        light.off()
        await light.apply()
        print(f"light blinking: {ip}")
        sleep(1)
        light.on()
        light.set_brightness(255)
        await light.apply()

To set or get the state of an light, you need to create a Light object, with the IP of the light.

The light class has getter and setter to change the state of the light or get further information about it.

If you wanna apply changes, use apply() to send the updated state to the bulb.

To retrieve the IPs of the lights you can use the discover() method. If everything worked this method will return a list containing all the IPs as strings.

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

wizpy-0.1.7.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file wizpy-0.1.7.tar.gz.

File metadata

  • Download URL: wizpy-0.1.7.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.3

File hashes

Hashes for wizpy-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7e0aa3fdf539723df3e2c6523c2a2d74f2587811e071166a8b856ecace02a8a4
MD5 d282cec73e295d61cffe45da163c207b
BLAKE2b-256 ce0416112fd15667b179ca43ce86c2607c3630c05ba691f74ffc9b38a2d09613

See more details on using hashes here.

Supported by

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