forked from davidbombal/red-python-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyeelight1.py
More file actions
38 lines (33 loc) · 704 Bytes
/
yeelight1.py
File metadata and controls
38 lines (33 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Make sure you install yeelight
# pip3 install yeelight
# Documentation here: https://yeelight.readthedocs.io/en/latest/
import time
from yeelight import Bulb
bulb = Bulb("192.168.0.105")
bulb.turn_on()
time.sleep(1)
bulb.set_rgb(255,0,0)
time.sleep(1)
bulb.set_rgb(164,168,50)
time.sleep(1)
bulb.set_rgb(50,90,168)
time.sleep(1)
bulb.set_rgb(168,50,50)
time.sleep(1)
bulb.set_rgb(50,168,54)
time.sleep(1)
bulb.set_rgb(255,0,0)
time.sleep(1)
rgb1 = 50
rgb2 = 10
rgb3 = 50
for i in range(10):
bulb.set_rgb(rgb1,rgb2,rgb3)
time.sleep(1)
i = i + 1
rgb1 = (i*10.5)
rgb2 = (i*5.5)
rgb3 = (i*9.5)
print(rgb1, rgb2, rgb3)
bulb.set_rgb(rgb1,rgb2,rgb3)
bulb.set_rgb(255,0,0)