From 114b19373e7ebb1ffe02d4b951ccf41cdad879bb Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Wed, 7 Apr 2021 15:51:38 -0400 Subject: [PATCH] Added Scenes & Started Twitch Command --- commands/implemented/command_light_color.py | 24 +++++++++++++++++++++ lights_module.py | 18 ++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 commands/implemented/command_light_color.py diff --git a/commands/implemented/command_light_color.py b/commands/implemented/command_light_color.py new file mode 100644 index 0000000..49d4d93 --- /dev/null +++ b/commands/implemented/command_light_color.py @@ -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) \ No newline at end of file diff --git a/lights_module.py b/lights_module.py index 3e78f60..c4350fe 100644 --- a/lights_module.py +++ b/lights_module.py @@ -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()