Skip to content

Commit

Permalink
Create yeelight1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbombal authored Apr 21, 2023
1 parent 5deef69 commit 3afe6cb
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions yeelight1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)

0 comments on commit 3afe6cb

Please sign in to comment.