adafruit_wiz
CircuitPython helper library for Wiz connected lights
Author(s): Tim Cocks
Implementation Notes
Hardware:
CircuitPython devices with built-in WIFI
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- adafruit_wiz.SCENE_IDS = {'Bedtime': 10, 'Candlelight': 29, 'Christmas': 27, 'Club': 26, 'Cool white': 13, 'Cozy': 6, 'Daylight': 12, 'Deepdive': 23, 'Fall': 22, 'Fireplace': 5, 'Focus': 15, 'Forest': 7, 'Golden white': 30, 'Halloween': 28, 'Jungle': 24, 'Mojito': 25, 'Night light': 14, 'Ocean': 1, 'Party': 4, 'Pastel Colors': 8, 'Plantgrowth': 19, 'Pulse': 31, 'Relax': 16, 'Rhythm': 1000, 'Romance': 2, 'Spring': 20, 'Steampunk': 32, 'Summer': 21, 'Sunset': 3, 'TV time': 18, 'True colors': 17, 'Wake up': 9, 'Warm White': 11}
Scene Name to Id mapping
- class adafruit_wiz.WizConnectedLight(ip: str, port: int = 38899, radio=None, debug: bool = False)
Helper class to control Wiz connected light over WIFI via UDP.
- Parameters:
- property brightness: int
The brightness level of the light. Valid range is 10-100
- Returns:
Brightness level
- property ip: str
IP of the Wiz connected light.
- Returns:
The IP address of the Wiz connected light.
- mode_from_status(status: dict) int
Get the current mode from the status and return it.
- Parameters:
status – Light status dictionary
- Returns:
The mode number
- property rgb_color: Tuple[int, int, int]
RGB color of the light. Set this property to change the light to an RGB color. Raises an exception if accessed while not in RGB mode.
- Returns:
Tuple containing red, green and blue values 0-255
- property scene: int
The SceneId of the light. Accessing the property returns int scene numbers. Setting the property can use the scene numbers or str names. See
SCENE_IDSfor valid scenes.- Returns:
Scene number
- property speed: int
The speed of dynamic scenes. Has no effect on static scenes. Valid range is 10-200.
- Returns:
Speed value
- property state: bool
Whether the light is on or off.
- Returns:
True if the light is on, False otherwise
- adafruit_wiz.scan(radio=None, timeout=3)
Scan the network for Wiz lights
- Parameters:
radio – The wifi radio object
timeout – Time in seconds to wait for responses to the scan broadcast
- Returns:
List of dictionaries containing info about found lights