Simple test
Ensure your device works with this simple test.
examples/wiz_simpletest.py
1# SPDX-FileCopyrightText: Copyright (c) 2024 Tim Cocks for Adafruit Industries
2#
3# SPDX-License-Identifier: MIT
4import time
5
6import wifi
7
8from adafruit_wiz import SCENE_IDS, WizConnectedLight
9
10udp_host = "192.168.1.143" # IP of UDP Wiz connected light
11udp_port = 38899 # Default port is 38899, change if your light is configured differently
12
13my_lamp = WizConnectedLight(udp_host, udp_port, wifi.radio)
14
15
16print(f"Current Status: {my_lamp.status}")
17
18print("Setting RGB Color")
19my_lamp.rgb_color = (255, 0, 255)
20time.sleep(2)
21
22print("Turning off")
23my_lamp.state = False
24time.sleep(2)
25
26print("Turning on")
27my_lamp.state = True
28
29print("Setting Light Color Temperature")
30my_lamp.temperature = 2200
31time.sleep(2)
32
33print("Lowering the Brightness")
34my_lamp.brightness = 10
35time.sleep(2)
36
37print("Raising the Brightness")
38my_lamp.brightness = 100
39
40print("Available Scenes:")
41print(SCENE_IDS.keys())
42print("Setting Scene")
43my_lamp.scene = "Party"