File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments