Added Rave Function
This commit is contained in:
parent
1c4d5d5b01
commit
e4f185678b
@ -1,6 +1,9 @@
|
|||||||
|
from time import sleep
|
||||||
import phue
|
import phue
|
||||||
from phue import Bridge
|
from phue import Bridge
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
import credentials
|
import credentials
|
||||||
import config
|
import config
|
||||||
|
|
||||||
@ -42,7 +45,16 @@ class Lights_Modules():
|
|||||||
#b.set_group(18, "bri", 254) #This is max Brightness
|
#b.set_group(18, "bri", 254) #This is max Brightness
|
||||||
#b.set_group(18, "on", True) #This is will turn ON
|
#b.set_group(18, "on", True) #This is will turn ON
|
||||||
xy_result = self.rgb_to_xy(0,0,1) #This will take an rgb value and make it xy
|
xy_result = self.rgb_to_xy(0,0,1) #This will take an rgb value and make it xy
|
||||||
b.set_group(18, "xy", xy_result) #This will make the lights in the group turn blue
|
b.set_group(16, "xy", xy_result) #This will make the lights in the group turn blue
|
||||||
|
|
||||||
|
# The Following will make a rave
|
||||||
|
for rave in range(2000):
|
||||||
|
rgb_r = random.random()
|
||||||
|
rgb_g = random.random()
|
||||||
|
rgb_b = random.random()
|
||||||
|
xy_result = self.rgb_to_xy(rgb_r, rgb_g, rgb_b) #This will take an rgb value and make it xy
|
||||||
|
b.set_group(16, "xy", xy_result)
|
||||||
|
sleep(0.5)
|
||||||
|
|
||||||
print("\n finished doing the things")
|
print("\n finished doing the things")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user