Added RGB Config Controls
This commit is contained in:
parent
7f1c991672
commit
1b317282c5
@ -17,27 +17,28 @@ class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
||||
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.TWITCH)
|
||||
|
||||
def do_command(self, bot, twitch_message):
|
||||
LightModule = lights_module.Lights_Module()
|
||||
LightModule.main()
|
||||
print("\nRGB Command Detected!")
|
||||
if bot.allow_rgbLightControl == True:
|
||||
LightModule = lights_module.Lights_Module()
|
||||
LightModule.main()
|
||||
print("\nRGB Command Detected!")
|
||||
|
||||
tempParsedMessage = twitch_message.text.split(" ")
|
||||
print("\nParsed Command! ", twitch_message.text)
|
||||
if (len(tempParsedMessage)) > 2:
|
||||
print("\nRGB Command!")
|
||||
rgb_r = float(tempParsedMessage[1])
|
||||
rgb_g = float(tempParsedMessage[2])
|
||||
rgb_b = float(tempParsedMessage[3])
|
||||
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
||||
print("got XY")
|
||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||
print("sent color")
|
||||
else:
|
||||
print("\nColor Command!")
|
||||
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
||||
print("got XY")
|
||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||
print("sent color")
|
||||
tempParsedMessage = twitch_message.text.split(" ")
|
||||
print("\nParsed Command! ", twitch_message.text)
|
||||
if (len(tempParsedMessage)) > 2:
|
||||
print("\nRGB Command!")
|
||||
rgb_r = float(tempParsedMessage[1])
|
||||
rgb_g = float(tempParsedMessage[2])
|
||||
rgb_b = float(tempParsedMessage[3])
|
||||
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
||||
print("got XY")
|
||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||
print("sent color")
|
||||
else:
|
||||
print("\nColor Command!")
|
||||
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
||||
print("got XY")
|
||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||
print("sent color")
|
||||
|
||||
returnMessage = "@" + twitch_message.sender + " changed the light's color!"
|
||||
bot.send_message(returnMessage)
|
||||
returnMessage = "@" + twitch_message.sender + " changed the light's color!"
|
||||
bot.send_message(returnMessage)
|
||||
@ -11,7 +11,7 @@ test_module: bool = False
|
||||
autoJoin_TwitchChannels = ["thecuriousnerd"]
|
||||
whitelisted_TwitchPowerUsers = ["thecuriousnerd"]
|
||||
|
||||
|
||||
#Twitch Module Configs
|
||||
block_TwitchChannelsMessaging = [""] # Blocks the ability to send messages to twitch channels
|
||||
blockAll_TwitchChatChannelsMessaging = False # Blocks the ability to send messages to twitch channels
|
||||
|
||||
@ -23,7 +23,9 @@ forceAll_TwitchChatChannelsTTS = False # forceAll supersedes the blockAll bool a
|
||||
|
||||
blockAll_TTS_URL_Twitch = True
|
||||
|
||||
autoEnabled_Twitch_rgbLightControl = False
|
||||
|
||||
#Discord Module Configs
|
||||
block_DiscordChannelsMessaging = [""] # Blocks the ability to send messages to Discord channels
|
||||
blockAll_DiscordChannelsMessaging = False # Blocks the ability to send messages to Discord channels
|
||||
blockAll_DiscordPrivateMessaging = False # Private Messaging not yet implemented
|
||||
@ -37,6 +39,9 @@ forceAll_DiscordChatChannelsTTS = False # forceAll supersedes the blockAll bool
|
||||
|
||||
blockAll_TTS_URL_Discord = True
|
||||
|
||||
autoEnabled_Discord_rgbLightControl = False
|
||||
|
||||
|
||||
|
||||
skip_splashScreen = False
|
||||
skip_splashScreenClear = False
|
||||
|
||||
@ -39,6 +39,8 @@ class Twitch_Module():
|
||||
self.cooldownModule:Cooldown_Module = Cooldown_Module()
|
||||
self.cooldownModule.setupCooldown("twitchChat", 20, 32)
|
||||
|
||||
self.allow_rgbLightControl = config.autoEnabled_Twitch_rgbLightControl
|
||||
|
||||
def join_channel(self, credential: credentials.Twitch_Credential, channel_name:str):
|
||||
channel_name = "#" + channel_name
|
||||
print("Connecting to Channel: " + channel_name + "...")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user