diff --git a/plexpy/config.py b/plexpy/config.py index 1b075a99..ef71cd1e 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -215,7 +215,7 @@ _CONFIG_DEFINITIONS = { 'HIPCHAT_URL': (str, 'Hipchat', ''), 'HIPCHAT_COLOR': (str, 'Hipchat', 'green'), 'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1), - 'HIPCHAT_INCL_EMOTICON': (str, 'Hipchat', ''), + 'HIPCHAT_EMOTICON': (str, 'Hipchat', ''), 'HIPCHAT_ENABLED': (int, 'Hipchat', 0), 'HIPCHAT_ON_PLAY': (int, 'Hipchat', 0), 'HIPCHAT_ON_STOP': (int, 'Hipchat', 0), diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index b44110de..6a6c9efb 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2755,7 +2755,7 @@ class HIPCHAT(object): self.apiurl = plexpy.CONFIG.HIPCHAT_URL self.color = plexpy.CONFIG.HIPCHAT_COLOR self.incl_subject = plexpy.CONFIG.HIPCHAT_INCL_SUBJECT - self.incl_emoticon = plexpy.CONFIG.HIPCHAT_INCL_EMOTICON + self.emoticon = plexpy.CONFIG.HIPCHAT_EMOTICON def notify(self, message, subject): if not message or not subject: @@ -2766,8 +2766,8 @@ class HIPCHAT(object): else: text = message.encode('utf-8') - if self.incl_emoticon: - text = self.incl_emoticon + ' ' + text + if self.emoticon: + text = self.emoticon + ' ' + text data = {'color': self.color, 'message': text, @@ -2797,11 +2797,13 @@ class HIPCHAT(object): logger.warn(u"PlexPy Notifiers :: Hipchat notification failed.") return False - def test(self, apiurl, color): + def test(self, apiurl, color, hipchat_emoticon, hipchat_incl_subject): self.enabled = True self.apiurl = apiurl self.color = color + self.emoticon = hipchat_emoticon + self.incl_subject = hipchat_incl_subject return self.notify('PlexPy', 'Test Message') @@ -2816,13 +2818,13 @@ class HIPCHAT(object): {'label': 'Hipchat Color', 'value': self.color, 'name': 'hipchat_color', - 'description': 'Color for the message to show up in your room. You' - ' may use any valid Hipchat message color value.', - 'input_type': 'text' + 'description': 'Background color for the message.', + 'input_type': 'select', + 'select_options': {'yellow': 'yellow', 'green': 'green', 'red': 'red', 'purple': 'purple', 'gray': 'gray', 'random': 'random'} }, {'label': 'Hipchat emoticon', - 'value': self.incl_emoticon, - 'name': 'hipchat_incl_emoticon', + 'value': self.emoticon, + 'name': 'hipchat_emoticon', 'description': 'Include an emoticon tag at the beginning of all notifications. Leave blank for none.' ' Use a stock emoticon or create a custom emoticon' ' here.',