-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
22 lines (19 loc) · 2.03 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Test WLED Matrix."""
import time
import asyncio
from wled import WLED
async def main() -> None:
async with WLED("IP_ADDRESS") as client:
# await client.segment(on=True, segment_id=0, brightness=64, individual=(
# 0,23,[0,176,240], 23,25,[255,255,255], 25,38,[0,176,240], 38,42,[255,255,255], 42,53,[0,176,240], 53,59,[255,255,255], 59,68,[0,176,240], 68,72,[255,255,255], 72,[0,176,240], 73,76,[255,255,255], 76,83,[0,176,240], 83,86,[255,255,255], 86,[0,176,240], 87,[255,255,255], 88,[0,176,240], 89,93,[255,255,255], 93,98,[0,176,240], 98,104,[255,255,255], 104,[0,176,240], 105,110,[255,255,255], 110,113,[0,176,240], 113,119,[255,255,255], 119,[0,176,240], 120,123,[255,255,255], 123,[0,176,240], 124,127,[255,255,255], 127,[0,176,240], 128,131,[255,255,255], 131,[0,176,240], 132,[255,255,255], 133,[0,176,240], 134,136,[255,255,255], 136,[0,176,240], 137,139,[255,255,255], 139,[0,176,240], 140,144,[255,255,255], 144,146,[0,176,240], 146,[255,255,255], 147,[0,176,240], 148,[255,255,255], 149,[0,176,240], 150,[255,255,255], 151,[0,176,240], 152,155,[255,255,255], 155,[0,176,240], 156,158,[255,255,255], 158,162,[0,176,240], 162,165,[255,255,255], 165,167,[0,176,240], 167,[255,255,255], 168,[0,176,240], 169,171,[255,255,255], 171,[0,176,240], 172,174,[255,255,255], 174,178,[0,176,240], 178,181,[255,255,255], 181,[0,176,240], 182,[255,255,255], 183,185,[0,176,240], 185,190,[255,255,255], 190,194,[0,176,240], 194,200,[255,255,255], 200,202,[0,176,240], 202,206,[255,255,255], 206,210,[0,176,240], 210,215,[255,255,255], 215,[0,176,240], 216,222,[255,255,255], 222,256,[0,176,240]
# ))
print("Red")
await client.segment(on=True, segment_id=0, brightness=128, color_primary=([255, 0, 0]))
time.sleep(5)
print("Green")
await client.segment(on=True, segment_id=0, brightness=128, color_primary=([0, 255, 0]))
time.sleep(5)
print("Blue")
await client.segment(on=True, segment_id=0, brightness=128, color_primary=([0, 0, 255]))
if __name__ == "__main__":
asyncio.run(main())