Added Scenes & Started Twitch Command
This commit is contained in:
parent
e4f185678b
commit
114b19373e
24
commands/implemented/command_light_color.py
Normal file
24
commands/implemented/command_light_color.py
Normal file
@ -0,0 +1,24 @@
|
||||
from abc import ABCMeta
|
||||
|
||||
from commands.command_base import AbstractCommand
|
||||
|
||||
import random
|
||||
|
||||
class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
||||
"""
|
||||
this is the roll command.
|
||||
"""
|
||||
command = "!color"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.TWITCH)
|
||||
|
||||
def do_command(self, bot, twitch_message):
|
||||
tempParsedMessage = twitch_message.text.split(" ")
|
||||
|
||||
rgb_r = float(tempParsedMessage[1])
|
||||
rgb_g = float(tempParsedMessage[2])
|
||||
rgb_b = float(tempParsedMessage[3])
|
||||
|
||||
diceRoll = "@" + twitch_message.sender + " changed the colors!"
|
||||
bot.send_message(diceRoll)
|
||||
@ -7,7 +7,7 @@ import random
|
||||
import credentials
|
||||
import config
|
||||
|
||||
class Lights_Modules():
|
||||
class Lights_Module():
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
@ -48,13 +48,19 @@ class Lights_Modules():
|
||||
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):
|
||||
for rave in range(20):
|
||||
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)
|
||||
#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.1)
|
||||
|
||||
#for stuffz in b.scenes:
|
||||
#print(stuffz)
|
||||
|
||||
# This will set the group Downstairs to the Stream scene
|
||||
#b.run_scene("Downstairs", "Stream")
|
||||
|
||||
print("\n finished doing the things")
|
||||
|
||||
@ -89,7 +95,7 @@ class Lights_Modules():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
testModule = Lights_Modules()
|
||||
testModule = Lights_Module()
|
||||
|
||||
credentials_manager = credentials.Credentials_Module()
|
||||
credentials_manager.load_credentials()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user