-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_custom_function.py
More file actions
20 lines (15 loc) · 755 Bytes
/
example_custom_function.py
File metadata and controls
20 lines (15 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from sunix_ledstrip_controller_client import Controller
from sunix_ledstrip_controller_client import LEDStripControllerClient
from sunix_ledstrip_controller_client import TransitionType
api = LEDStripControllerClient()
# devices = api.discover_controllers()
device = Controller(api, "192.168.2.37")
# create a list of color-channel tuples
colors = [(255, 0, 0, 255),
(0, 255, 0),
(0, 0, 255)]
# the function can (as far as I know) only control the RGB values, the WW values remain untouched.
# you can use this to your advantage (dimmed ambient white light) or simply turn the WW channels off beforehand
device.set_ww(0, 0)
# then set your custom function like this
device.set_custom_function(colors, 250, TransitionType.Gradual)