diff --git a/channel_rewards/implemented/ChannelReward_Hydration.py b/channel_rewards/implemented/ChannelReward_Hydration.py index d777da2..cb16a2c 100644 --- a/channel_rewards/implemented/ChannelReward_Hydration.py +++ b/channel_rewards/implemented/ChannelReward_Hydration.py @@ -18,13 +18,15 @@ class ChannelReward_Hydration_v2(AbstractChannelRewards, metaclass=ABCMeta): self.isChannelRewardEnabled = True def do_ChannelReward(self, source = AbstractChannelRewards.ChannelRewardsSource.default, user = "User", rewardName = "", rewardPrompt = "", userInput = "", bonusData = None): - self.dothething(user, "16", "lights hydration") + #print("sending:",user, 16, "!lights hydration") + self.dothething(user, 16, "!lights hydration", "") return None - def dothething(self, username, light_group, command): + def dothething(self, username, light_group, command, rest): # todo need to url-escape command and rest - params = urlencode({'user_name': username, 'light_group': light_group, 'command': command}) + params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest}) + #standalone_lights url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params resp = requests.get(url) if resp.status_code == 200: diff --git a/standalone_lights.py b/standalone_lights.py index 875a0d8..2907fc8 100644 --- a/standalone_lights.py +++ b/standalone_lights.py @@ -207,12 +207,16 @@ RGB_Lights = Lights_Module() def init(): RGB_Lights.main() -def do_light_command(user="", lightGroup="all", command = "", rest = ""): +def do_lights_command(user="", lightGroup="all", command = "", rest = ""): returnString = "None" print("about to do something ......") #bot.return_message("\nRGB Command Detected!") - tempFix = command + " " + rest + if rest is not "": + tempFix = command + " " + rest + else: + pass + tempFix = command tempParsedMessage = tempFix.split(" ") sceneCommand = False @@ -275,7 +279,8 @@ def exec_lights(): return flask.make_response('{\"text\":"Argument \'scene_name\' not in request"}', 400) print("about to do something ......") - return do_light_command(user_name, request.args['light_group'], request.args['command'], request.args['rest']) + RGB_Lights.main() + return do_lights_command(user_name, request.args['light_group'], request.args['command'], request.args['rest']) if __name__ == "__main__": init()