Skip to content

Commit 3afe6cb

Browse files
authored
Create yeelight1.py
1 parent 5deef69 commit 3afe6cb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

yeelight1.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Make sure you install yeelight
2+
# pip3 install yeelight
3+
4+
# Documentation here: https://yeelight.readthedocs.io/en/latest/
5+
6+
import time
7+
from yeelight import Bulb
8+
bulb = Bulb("192.168.0.105")
9+
10+
bulb.turn_on()
11+
time.sleep(1)
12+
bulb.set_rgb(255,0,0)
13+
time.sleep(1)
14+
bulb.set_rgb(164,168,50)
15+
time.sleep(1)
16+
bulb.set_rgb(50,90,168)
17+
time.sleep(1)
18+
bulb.set_rgb(168,50,50)
19+
time.sleep(1)
20+
bulb.set_rgb(50,168,54)
21+
time.sleep(1)
22+
bulb.set_rgb(255,0,0)
23+
time.sleep(1)
24+
25+
rgb1 = 50
26+
rgb2 = 10
27+
rgb3 = 50
28+
for i in range(10):
29+
bulb.set_rgb(rgb1,rgb2,rgb3)
30+
time.sleep(1)
31+
i = i + 1
32+
rgb1 = (i*10.5)
33+
rgb2 = (i*5.5)
34+
rgb3 = (i*9.5)
35+
print(rgb1, rgb2, rgb3)
36+
bulb.set_rgb(rgb1,rgb2,rgb3)
37+
38+
bulb.set_rgb(255,0,0)

0 commit comments

Comments
 (0)